如何更快地显示rspec错误?

时间:2012-07-23 11:57:49

标签: ruby-on-rails rspec

我的rspec测试套件很慢。运行所有测试大约需要五年时间。在它运行时,我只看到测试失败。

.......................................................................
.......FFFFFFFFFFFFFFF....F..........FFFFFFFFF.........................
................FFFFFFFFFFFFFFF.....................FF.................
..........................FFF..........................................
.............FFFFFFFFFFFFFFFFFFFFFF....................................
................................................................FFFF...
.......FFFFFFFFF..........................

然后,在盯着这几年后,我终于得到了一个错误列表。

Failures:

  172481) Foobar should barfoo the barbaz while quux is set to narf
     Failure/Error: before { click_link "Enable narf" }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # ./app/helpers/foobar_helper.rb:22:in `gobble'
     # ./app/controllers/barbaz_controller.rb:18:in `omgwtf'
     # (eval):2:in `click_link'
     # ./spec/requests/metasyntactic_spec.rb:43:in `block (5 levels) in <top (required)>'

有没有办法告诉rspec它应该直接显示错误 - 在运行测试套件时?

1 个答案:

答案 0 :(得分:6)

您可以使用fuubar格式,请参阅此处的文档:https://github.com/jeffkreeftmeijer/fuubar/