Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3.1 engine rake db:test:prepare task missing

I'm working on a rails 3.1 engine, and as it's a brand new release and I'm working off of edge, I didn't expect things to go perfectly. I can't seem to get my engine to see the db:test:prepare task when I run bundle exec rake -T

I'm using rake 0.8.7 and edge rails. If I try to require the dummy application's Rakefile, I get

undefined method 'prerequisites' for nil:NilClass on line 7 of spec/dummy/Rakefile

Line 7 of my Rakefile in spec/dummy/ is Dummy::Application.load_tasks

My research so far has brought me to http://www.engineyard.com/blog/2010/rails-3-beta-is-out-a-retrospective/ which corresponds with databases.rake in Active Record.

How do I get the db:test:prepare task into my engine?

like image 806
SpaceGhost Avatar asked May 22 '11 10:05

SpaceGhost


3 Answers

I think you have to prefix with app, so rake app:db:test:prepare, or just rake app:test:prepare.

like image 68
Kris Avatar answered Nov 12 '22 04:11

Kris


Looks like http://blog.davidchelimsky.net/2011/05/22/rspec-rails-261beta1-is-released/ is the answer.

The reason being is that it guards against calling prerequisites on nil and will work with Rails 3.1 RC (or edge at this moment in time).

like image 4
Omar Qureshi Avatar answered Nov 12 '22 06:11

Omar Qureshi


As far as I know, then it's just called rake test:prepare in rails 3.1

like image 1
Jesper Blad Jensen Avatar answered Nov 12 '22 04:11

Jesper Blad Jensen