Technical
Cruise Controll With RSpec

Ya, that was a bummer.

Problems you will encounter

This is a script that I’ve compiled from many places to get it work.
Ugly, but it works.


require File.join(RAILS_ROOT, '/vendor/plugins/rspec/lib/spec/rake/spectask')
#THIS SETS ENV and the only way how I could properly set it
task :prepare do
  RAILS_ENV = 'test'
end

task :cruise => [:prepare,"db:migrate"] do
        Rake::Task["cruise_spec"].invoke
end

Spec::Rake::SpecTask.new(:cruise_spec) do |t|
   t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
   t.spec_files = FileList['spec/**/*_spec.rb']
end

Thanks to

http://www.paperplanes.de/archives/2007/12/13/cruisecontrolrb_and_rspec_play_nice/