I just started working on a project that has a test suite built with
shoulda. I'm new to shoulda, and I'm seeing a number of failures in
the test suite. I've tracked the errors down to records in the db
persisting between tests. If I put in explicit calls to clear out the
tables in question in appropriate setup blocks, then the tests pass
fine. I'm pulling in fixtures for the tables in question, which
solved this sort of problem back in the test:unit days.
I'm not sure where the error is coming from. Are the tests using
shoulda incorrectly? Am I invoking shoulda incorrectly (failures
occur with both the rake test:x tasks and ruby test/unit/blah_test.rb
method)? Is it expected that I should have to clean out the db
manually with each test?
Thanks in advance for any answers, and if more information is
required, I'm happy to provide it.
Short answer: problem solved.