of a very short development cycle: first the developer writes an (initially failing) automated test case that defines a desired improvement, then produces the minimum amount of code to pass that test, and finally refactors the new code to acceptable standards." Wikipedia
User.new } describe "its registration process" do let(:address) { AnObject.new } let(:phone) { Another.new } let(:children) { OtherOne.new } let(:mailer) { AnyObject.new } # etc... it "saves the related address" do # Test saving of the address end it "saves the related children" do # Test saving of children end it "saves the related phones" ... it "saves the user" ... it "sends and email to the user" ... end end
machine • minitest/unit: TDD API • minitest/spec: BDD API • minitest/mock: Simple mocking API • minitest/pride: IO pipelining example • minitest/bench: Abstract benchmark API
comparison with RSpec ◦ Very Fast • Isolated Tests ◦ Test Randomization: Prevents order dependencies • Indirection is the Enemy ◦ Failures pointing to the failure