---
title: "優雅的 RSpec 測試"
permalink: "https://blog.aotoki.me/series/elegant-rspec/"
language: "zh-tw"
---

# 優雅的 RSpec 測試


RSpec 是 Ruby 中經常被使用的測試框架， 優雅的 RSpec 測試系列是將過去數年撰寫測試的經驗會整合成，以「可讀」與「容易維護」的角度思考，如何將 RSpec 測試優雅撰寫出來。


- [優雅的 RSpec 測試 - 探索式的測試與重構](https://blog.aotoki.me/posts/2023/05/19/elegant-rspec-exploration-testing-and-refactor/index.md) — 2023-05-19
- [優雅的 RSpec 測試 - 耦合與依賴注入](https://blog.aotoki.me/posts/2023/05/12/elegant-rspec-coupling-and-dependency-inject/index.md) — 2023-05-12
- [優雅的 RSpec 測試 - 物件的可測試性](https://blog.aotoki.me/posts/2023/05/05/elegant-rspec-the-testability/index.md) — 2023-05-05
- [優雅的 RSpec 測試 - Spy 的應用](https://blog.aotoki.me/posts/2023/04/28/elegant-rspec-the-spy-usage/index.md) — 2023-04-28
- [優雅的 RSpec 測試 - Allow 變化應用](https://blog.aotoki.me/posts/2023/04/21/elegant-rspec-another-allow-usage/index.md) — 2023-04-21
- [優雅的 RSpec 測試 - Allow 的使用方式](https://blog.aotoki.me/posts/2023/04/14/elegant-rspec-the-allow-usage/index.md) — 2023-04-14
- [優雅的 RSpec 測試 - Mock 與 Stub](https://blog.aotoki.me/posts/2023/04/07/elegant-rspec-mock-and-stub/index.md) — 2023-04-07
- [優雅的 RSpec 測試 - 測試替身](https://blog.aotoki.me/posts/2023/03/31/elegant-rspec-test-double/index.md) — 2023-03-31
- [優雅的 RSpec 測試 - 輔助方法](https://blog.aotoki.me/posts/2023/03/24/elegant-rspec-test-helper/index.md) — 2023-03-24
- [優雅的 RSpec 測試 - 自訂匹配器](https://blog.aotoki.me/posts/2023/03/17/elegant-rspec-customize-matcher/index.md) — 2023-03-17
- [優雅的 RSpec 測試 - 共用案例](https://blog.aotoki.me/posts/2023/03/10/elegant-rspec-shared-example/index.md) — 2023-03-10
- [優雅的 RSpec 測試 - 錯誤匹配](https://blog.aotoki.me/posts/2023/03/03/elegant-rspec-error-matcher/index.md) — 2023-03-03
- [優雅的 RSpec 測試 - 內容匹配](https://blog.aotoki.me/posts/2023/02/24/elegant-rspec-content-matcher/index.md) — 2023-02-24
- [優雅的 RSpec 測試 - 常見匹配器](https://blog.aotoki.me/posts/2023/02/17/elegant-rspec-common-matcher/index.md) — 2023-02-17
- [優雅的 RSpec 測試 - 前置處理](https://blog.aotoki.me/posts/2023/02/10/elegant-rspec-prepare-test/index.md) — 2023-02-10
- [優雅的 RSpec 測試 - 組織測試](https://blog.aotoki.me/posts/2023/02/03/elegant-rspec-organize-test/index.md) — 2023-02-03
- [優雅的 RSpec 測試 - 測試案例](https://blog.aotoki.me/posts/2023/01/27/elegant-rspec-example/index.md) — 2023-01-27
- [優雅的 RSpec 測試 - RSpec 概觀](https://blog.aotoki.me/posts/2023/01/20/elegant-rspec-overview/index.md) — 2023-01-20
- [優雅的 RSpec 測試 - 撰寫測試的方式](https://blog.aotoki.me/posts/2023/01/13/elegant-rspec-how-to-write-test/index.md) — 2023-01-13
- [優雅的 RSpec 測試 - 前言](https://blog.aotoki.me/posts/2023/01/06/elegant-rspec-preface/index.md) — 2023-01-06

