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?
I think you have to prefix with app
, so rake app:db:test:prepare
, or just rake app:test:prepare
.
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).
As far as I know, then it's just called rake test:prepare in rails 3.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With