CruiseControl.rb 与 RSpec:Rake 任务“spec”;未找到
我正在尝试将 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 任务。我还尝试在 Rakefile
中定义自定义 rake 任务,并删除 中的
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
Does Anybody has CruiseControl.rb与RSpec一起工作?
I'm trying to use CruiseControl.rb (ver. 2.0.0pre1) with RSpec for my Ruby on Rails 3 app. The cruise_config.rb
for my project looks like this:
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
But when I try to run a build with CruiseControl, it says:
rake aborted!
Custom rake task(s) 'spec' not defined
Tasks: TOP => cc:build
(See full trace by running task with --trace)
It can't find the spec rake task to run the RSpec tests. I also tried to define a custom rake task inside my Rakefile
and removed the project.rake_task = 'db:migrate db:test:prepare spec'
line inside the 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
If i do so, CruiseControl says
rake aborted!
ActiveRecord::ConnectionNotEstablished
Tasks: TOP => cruise
(See full trace by running task with --trace)
[CruiseControl] Invoking Rake task "cruise"
Custom Rake task
Does anybody have CruiseControl.rb working with RSpec?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您在
Rakefile
中定义了:spec
任务,对于 RSpec 2,它如下所示:Ensure that you have the
:spec
task defined in yourRakefile
, for RSpec 2, it looks like this: