I’ve been working through the AWDWR book (both hard copy first edition
and “beta book” pdf of second and I’m running into some problems when
running unit tests.
Integration tests and functional tests are behaving correctly and are
operating against the test database. However unit tests try to operate
against the development database and fail.
(ie rake test:unit doesn’t appear to respect the environment variable)
Running the unit tests manually (ruby test/unit/test_name.rb ) works.
Running a “rake test” successfully runs the functional, then the
integration, and then reports
“rake aborted!
Test failures”
Looking at the development log, I see that its trying to drop and
create tables, but and fails due to some dependencies. This is the
exact same behavoir I see if I run rake test:unit so I think that’s the
culprit.
Looking into the testing.rake file, I see that
unit/functional/integration are all dependent on the db:test:prepare
task. I can’t see why one would use the development environment and the
others use the test?
Eric