On 8/15/06, court3nay <[EMAIL PROTECTED]> wrote:
Background: I've got an app that doesn't use the DB (long story..)
and running tests is certainly a chore when you don't have any DB
connection.
Also, due to the way rails extends TestCase, running tests in  your
suite that aren't tied to AR can have issues.

Part of the solution involved renaming the main test class, such that
test_helper becomes

class NoDbTest < Test::Unit::TestCase


and all the unit and functional tests inherit from NoDbTest.

I propose that rails' test class inherits from, rather than extends,
Text::Unit::TestCase.

Someone had a patch to skip the db if the database config is empty or no fixtures are declared. It broke the internal AR tests, but that could be worked around by providing a dummy config. It'd solve your immediate problem.

Rails should do the right thing with TestCase but getting there demands a painful deprecation step nobody's eager to take.

jeremy
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to