So writing tests feels painful. What now?
summary
Painful RSpec work turns into a concrete refactor: an RSpec + FactoryBot test initially stubs Stripe::Subscription.new and stubs Trial.start, uses allow/expect to mock update and reaches green only after blocking external Stripe calls (WebMock errors show up). That brittle test prompts extracting a notified_update_with_trial method on the subscription, moving assertions into the Stripe subscription spec, and reducing stubbing and duplication. Expect hands‑on examples of the failing test, the stubbing sequence, and the minimal refactor that actually makes tests easier to trust.
AI-written summary · about
chapters (16)
- 0:00Testing pain introduction
- 1:51Why testing feels overwhelming
- 3:58Pet crowdfunding example
- 7:30What tests are really for and why they matter
- 8:56Navigating messy tests
- 13:34Hidden dependencies revealed
- 15:00Taking a break
- 15:42Characterization tests
- 16:45Trustworthy tests reduce fear of change
- 17:49Reducing class responsibilities
- 21:21Encapsulating behavior
- 23:08Refactoring worth it
- 23:51Testing feedback loops
- 24:55Small testing improvements
- 26:00Quality in software design
- 27:24Closing thoughts
related talks
29m"Testing. Why so serious?"
06mAvoiding Sneaky Testing Antipatterns
34mBetter Code Through Boring(er) Tests
46mBetter code through boring(er) tests
31mGoing on a Testing Anti-Pattern Safari
34mEliminating Inconsistent Test Failures
16mTDD Workshop: Mocking, Stubbing, and Faking External Services
40mTest Doubles are Not To Be Mocked
