我们的测试需要一段时间才能运行,并且总有5-10分钟的时间段,我们知道哪个测试失败了,但在套件完成之前,我们看不到失败消息或回溯。在发生的时候看到回溯会更有效率。这个是可能的吗?
发布于 2013-01-09 18:13:41
您有两个选择:
1) fast失败
# spec/spec_helper.rb
RSpec.configure do |c|
c.fail_fast = true
end..or从命令行使用它
$ bundle exec rspec spec/ --fail-fast
.F
Failures:
1) Swinger should set the Capybara driver
Failure/Error: Capybara.current_driver.should_not == :rack_test
Finished in 0.00479 seconds
2 examples, 1 failure基本上,此选项在出错时将停止测试套件,并打印错误。
2)使用rspec-instafail gem
https://github.com/grosser/rspec-instafail
这个gem将立即显示失败的规范,并将继续运行规范。
发布于 2013-01-09 16:11:34
我使用Fuubar在套件继续运行时获得即时失败消息和回溯,并获得测试套件进展情况的更有意义的指示器。
https://stackoverflow.com/questions/14230113
复制相似问题