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”
end
Cucumber::Rake::Task.new(:cruise) do |t|
t.cucumber_opts = “–format pretty
–out=#{ENV[‘CC_BUILD_ARTIFACTS’]}/features.txt --format html
–out=#{ENV[‘CC_BUILD_ARTIFACTS’]}/features.html”
t.rcov = true
t.rcov_opts = %w{–rails --exclude osx/objc,gems/,spec/}
t.rcov_opts << %[-o
“#{ENV[‘CC_BUILD_ARTIFACTS’]}/code_coverage/features”]
end
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”]
end
end
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.