Rake test:engines causes some issues for fixtures

Hi all,

For some reason I was getting some problems with initialising fixtures
when I had multiple engines: it looks as though engine A is looking
for its fixtures in engine B’s fixture directory. This can be solved,
for me, if, rather than instantiating one Rake::TestTask for all
engines tests you instantiate one per-engine, so I changed my
tasks/engines.rake file so that the test:engines task reads like:

namespace :test do
desc “Run the engine tests in vendor/plugins/**/test (or specify
with ENGINE=name)”

NOTE: we’re using the Rails 1.0 non-namespaced task here, just to

maintain

compatibility with Rails 1.0

TODO: make this work with Engines.config(:root)

(ENV[‘ENGINE’] || Dir['vendor/plugins/’].map { |d| File.basename(d)
}).each do |engine|
Rake::TestTask.new(:engines => :prepare_test_database) do |t|
t.libs << “test”
t.pattern = "vendor/plugins/#{ engine }/test/**/
_test.rb"
t.verbose = true
end
end
end

This solves my problem but I’m wondering if I’m the only person seeing
this and, if not, whether this change should/could be integrated into
the trunk? I’ve done this against the rel_1.1.3 tag but checking the
trunk seems that this file hasn’t been changed in this regard.

Matt

I think this is covered by this ticket:
http://dev.rails-engines.org/tickets/120

Expect a fix in the next release - Cheers,

  • james

On 8/7/06, James A. [email protected] wrote:

I think this is covered by this ticket: http://dev.rails-engines.org/tickets/120

Guess it helps to check the bugs first!

Expect a fix in the next release - Cheers,

Thanks!

Matt

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs