[rspec-users] rake features does not seem to run rake db:test:prepare

James Byrne lists at ruby-forum.com
Tue Jan 27 12:05:08 EST 2009

This may be misunderstanding on my part but I thought that running rake
features would automatically run rake db:test:prepare.  However, this
does not seem to be the case.  Am I mistaken or is this a bug?

The rake task I am using is this:

#in ./lib/tasks/cucumber.rake
desc "Exercise cucumber features"
task :features => 'db:test:prepare'
task :features => "features:all"
#task :features => 'db:test:prepare'
require 'cucumber/rake/task' #I have to add this -mischa

namespace :features do
  Cucumber::Rake::Task.new(:all) do |t|
    t.cucumber_opts = "--format pretty"

  Cucumber::Rake::Task.new(:cruise) do |t|
    t.cucumber_opts = "--format pretty
--out=#{ENV['CC_BUILD_ARTIFACTS']}/features.txt --format html
    t.rcov = true
    t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/}
    t.rcov_opts << %[-o

  Cucumber::Rake::Task.new(:rcov) do |t|
    t.rcov = true
    t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/}
    t.rcov_opts << %[-o "code_coverage/features"]

I moved the task :features => 'db:test:prepare' statement from after
task :features => "features:all" to before it, but this does not
influence the observed behaviour.

This issue came to my attention when I discovered that changes to the
migrations were not showing up in the test database unless I manually
did rake db:test:prepare.
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list