Forum: Rails Engines development Rake test:engines causes some issues for fixtures

Posted by Matthew Denner (Guest)
on 2006-08-07 14:27
(Received via mailing list)
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
Posted by James Adam (Guest)
on 2006-08-07 14:48
(Received via mailing list)
I think this is covered by this ticket: 
http://dev.rails-engines.org/tickets/120

Expect a fix in the next release - Cheers,

- james
Posted by Matthew Denner (Guest)
on 2006-08-07 14:54
(Received via mailing list)
On 8/7/06, James Adam <james.adam@gmail.com> 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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.