我正在尝试将 CruiseControl.rb(版本 2.0.0pre1)与 RSpec 一起用于我的 Ruby on Rails 3 应用程序。我的cruise_config.rb
项目看起来像这样:
Project.configure do |project|
project.rake_task = 'db:migrate db:test:prepare spec'
project.scheduler.polling_interval = 1.hour
project.scheduler.always_build = false
end
但是当我尝试使用 CruiseControl 运行构建时,它会说:
rake aborted!
Custom rake task(s) 'spec' not defined
Tasks: TOP => cc:build
(See full trace by running task with --trace)
它找不到运行 RSpec 测试的 spec rake 任务。我还尝试在我的内部定义一个自定义 rake 任务,Rakefile
并删除了project.rake_task = 'db:migrate db:test:prepare spec'
内部的行cruise_config.rb
:
desc "Custom Task for CruiseControl.rb"
task :cruise do
puts "Custom Rake task"
Rake::Task['db:migrate'].execute
Rake::Task['db:test:prepare'].execute
Rake::Task['spec'].execute
end
如果我这样做,CruiseControl 会说
rake aborted!
ActiveRecord::ConnectionNotEstablished
Tasks: TOP => cruise
(See full trace by running task with --trace)
[CruiseControl] Invoking Rake task "cruise"
Custom Rake task
有人有 CruiseControl.rb 与 RSpec 合作吗?