Rails Testing Notes
Okay, so there is a little ambiguity on a few things that shoulda and rails testing does for you:
XUnit Testing Frameworks 101:
-setup and teardown methods run before and after (respectively) EACH test method in a TestCase or shoulda context gets run, not once at the beginning of the context/TestCase and once at the end
They are tremendously useful for avoiding code duplication and making your test cases read easier.
(gleaned from reading and analyzing source)
-Rails unit and functional tests have a top level parent that extends Test::Unit::TestCase (part of the ruby standard lib)
The core concept behind this testing methodology is here--also mentioned in the Programming Ruby book--understand it.
should_eventually "be the best dang program in the whole world" do
is how you specify test cases you haven't written yet, but you know you'll need them...
(gleaned from shoulda source code inspection)
- This mock/stub framework is awesome. Make sure you understand how to:
Object#expects and all of the goodies in Mocha::Expectation (especially never, raises, once methods)