如果Rspec 3中的rake规范总是以“rake aborted”结束

时间:2010-11-07 15:51:38

标签: rspec2

每次我使用Rspec2和Rails3运行rake规范时,它都会以rake中止完成。想知道这是正常的行为,还是我在路上犯了一些错误?


........
Finished in 0.01589 seconds
7 examples, 6 failures, 1 pending


rake aborted!
ruby -S bundle exec rspec "./spec/helpers/homes_helper_spec.rb" "./spec/models/habit_spec.rb" failed
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rspec-core-2.0.1/lib/rspec/core/rake_task.rb:117:in `initialize'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:1112:in `verbose'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rspec-core-2.0.1/lib/rspec/core/rake_task.rb:109:in `send'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rspec-core-2.0.1/lib/rspec/core/rake_task.rb:109:in `initialize'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/Users/jack/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/bin/rake:31
/Users/jack/.rvm/gems/ruby-1.8.7-p174/bin/rake:19:in `load'
/Users/jack/.rvm/gems/ruby-1.8.7-p174/bin/rake:19

2 个答案:

答案 0 :(得分:5)

当你失败时它是正常的。

答案 1 :(得分:2)

目前,做rspec spec/不会产生巨大的耙子流产!"堆栈跟踪,但默认情况下,您的Rakefile任务将。要抑制这种情况,请尝试在Rakefile中粘贴这样的东西。

# This clears the default spec task from MyApp::Application.load_tasks
Rake::Task["spec"].clear 

# This defines your new spec task with a suppressed stack trace
RSpec::Core::RakeTask.new(:spec) do |t|
  t.fail_on_error = false
end