Rspec 3 中的 rake 规范是否应该始终以“rake aborted”结尾?

发布于 2024-10-01 17:36:53 字数 2360 浏览 1 评论 0原文

每次我使用 Rspec2 和 Rails3 运行 rake spec 时,它都会以 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

Everytime I run rake spec with Rspec2 and Rails3 it finishes with rake aborted. Wondering if this is normal behaviour or if I have made some mistake along the way?


........
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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

知你几分 2024-10-08 17:36:53

当你遇到失败时,这很正常。

Its normal when you've got failures.

回忆追雨的时光 2024-10-08 17:36:53

目前,执行 rspec spec/ 不会产生巨大的“rake aborted!”堆栈跟踪,但默认情况下,您的 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

At the moment, doing rspec spec/ will not produce the huge "rake aborted!" stack trace, but by default, your Rakefile task will. To suppress this, try sticking something like this in your 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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文