Here are my notes for each chapter of Sandi Metz's fantastic bible of good object-oriented design, which applies to ALL object-oriented languages and will be true for your whole software career. See my Markdown files (.md) for a summary of each chapter.
I rewrote all her Minitest software tests in RSpec.
Sandi's final versions of all her book code are in /lib.
In top level directory, to run all Minitest tests, type:
rake
To run all RSpec tests, type
rspec
2 of the tests will fail if you run them in bulk this way. However, if you test that 1 file directly, these 2 tests pass:
ruby test/ch9d_test.rb (Minitest)
rspec spec/ch9d_spec.rb (RSpec)
These 2 tests are for a mock "observer" object, to see if Gear actually sends it a message to :change. For some reason, the group rake and rspec way of running tests cannot deal with this mock object, thinking "observer" is nil.
However, testing just that 1 file will work. If you have questions/comments, please say hi:
- Raymond Gan | [email protected] | http://twitter.com/rgan0