当我快速失败运行rspec时,它给我的输出超出了我的需要。如下所示,运行时会打印一个错误,然后在摘要中再次打印。这在我进行视图测试时尤其麻烦,因为在我的控制台中可以渲染数百行标记。根本不好玩。
Running tests with args ["--color", "--failure-exit-code", "2", "--format", "RSpec::Instafail", "--format", "Guard::RSpec::Formatter", "--require", "rspec/instafail", "--require", "/Users/peter/.rvm/gems/ruby-1.9.3-p429/gems/guard-rspec-3.0.0/lib/guard/rspec/formatter.rb", "spec/views/layouts/application.html.erb_spec.rb"]...
1) layouts/application.html.erb will fail
Failure/Error: raise "An example error"
RuntimeError:
An example error
# ./spec/views/layouts/application.html.erb_spec.rb:9:in `block (2 levels) in <top (required)>'
Failures:
1) layouts/application.html.erb will fail
Failure/Error: raise "An example error"
RuntimeError:
An example error
# ./spec/views/layouts/application.html.erb_spec.rb:9:in `block (2 levels) in <top (required)>'
Finished in 0.07728 seconds
1 example, 1 failure
Failed examples:
rspec ./spec/views/layouts/application.html.erb_spec.rb:8 # layouts/application.html.erb will fail
]2;[RSpec results] 1 examples, 1 failures
Randomized with seed 6737
前6行非常重要,接下来的16行会变成噪音。我怎么能省略它们?谢谢!