# Rake test:engines causes some issues for fixtures

**URL:** <https://www.ruby-forum.com/t/rake-test-engines-causes-some-issues-for-fixtures/101691>\
**Category:** Engines Development\
**Created:** [August 7, 2006, 2:27pm UTC](https://www.ruby-forum.com/t/rake-test-engines-causes-some-issues-for-fixtures/101691 "2006-08-07T14:27:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthew\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@matthew\_d](https://www.ruby-forum.com/u/matthew_d)\
**Post date:** [August 7, 2006, 2:27pm UTC](https://www.ruby-forum.com/t/rake-test-engines-causes-some-issues-for-fixtures/101691/1 "2006-08-07T14:27:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![matthew\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@matthew\_d](https://www.ruby-forum.com/u/matthew_d)\
**Post date:** [August 7, 2006, 2:48pm UTC](https://www.ruby-forum.com/t/rake-test-engines-causes-some-issues-for-fixtures/101691/2 "2006-08-07T14:48:28Z")

</div>

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

Expect a fix in the next release - Cheers,

- james

---

<div class="post-metadata">

**Author:** ![matthew\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@matthew\_d](https://www.ruby-forum.com/u/matthew_d)\
**Post date:** [August 7, 2006, 2:54pm UTC](https://www.ruby-forum.com/t/rake-test-engines-causes-some-issues-for-fixtures/101691/3 "2006-08-07T14:54:28Z")

</div>

On 8/7/06, James A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I think this is covered by this ticket: [http://dev.rails-engines.org/tickets/120](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
