← Graph

Prefer fixtures and stubs over factories and mocks

takeaway 1 connections

Pragmatic testing tradeoffs recommended in Counterintuitive Rails pt. 2. Fixtures beat factories for speed, cross-references, and the ability to reload exploratory scenarios into the dev database. Stubs beat mocks because mocks verify call structure, turning black-box tests into white-box tests that break on any restructuring. RSpec's matcher ecosystem is overvalued; minitest plus power_assert gives enough expressivity without locking knowledge into a framework-specific DSL.

type
recommendation
takeaway Prefer fixtures and stubs over factories and mocks
from_talk
Summarizes the test-doubles guidance section.

Provenance

Read by
4 extractions