Hello all,

I've been doing quite a bit of rooting around the plugin system
recently, and one thing in particularly has me puzzled and bemused. At
the moment, the test:plugins task has a dependency on the :environment
task, thus loading up Rails in all it's resplendent glory. Once it's
done this it uses Rake::TestTask to load the tests for every plugin.

However, because of the way that Rake::TestTask works (loading a new
Ruby interpreter which churns through the test cases), the Rails
environment is never actually made available to any plugins. If a
plugin wants to deal with ActiveRecord, it needs to explicitly load
Rails itself within it's tests. The environment isn't even used to
determine which plugin tests to run.

Basically, the dependency is pointless beyond introducing a delay
before starting the plugin test tasks. Any esoteric side effect of
environment.rb's evaluation shouldn't influence plugins while they are
being tested (a plugin which relies on this is badly written, IMHO).

Am I missing something obvious here?

- James

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

Reply via email to