How can I declare task dependencies to a TestTask ?
In this example, 'clean_database' task should be run before integration task
Rake::TestTask.new(:integration) do |t|
t.libs << "test"
t.test_files = FileList['test/**/integration/**/test*.rb']
t.verbose = true
end
task :clean_database => [:init] do
#...
end
Rake enables redefining existing tasks, so this should be possible (add it to your existing code):
task :integration => :clean_database
You can pass in the dependency to the TestTask initializer:
Rake::TestTask.new(:integration => :clean_database) do |t|
t.libs << "test"
t.test_files = FileList['test/**/integration/**/test*.rb']
t.verbose = true
end
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