Interfaces Not Required
summary
Argument: formal interfaces are unnecessary in Ruby because tests provide stronger guarantees. Uses RSpec shared_examples to specify a repository contract: methods fine_by_id create update, create returns integer id or false, find_by_id returns entity or nil, update returns id or false. Adds behavioral assertions that the id from create or update roundtrips through find_by_id. Demonstration shows a portable test suite that enforces behavioral safety across implementations so Interfaces Not Required becomes actionable.
AI-written summary · about
chapters (7)
- 0:00Start
- 0:33Cory Brown
- 5:14Active Record
- 5:28Repository Pattern
- 6:33The Behavior for a Repository
- 9:45R-Spec Shared Example
- 19:14Cognitive Load








