2013-08-01 86 views
1

當我運行rspec快速失敗時,它給我比我需要更多的輸出。正如您在下面看到的,運行時會打印出一個錯誤,然後再次打印出總結。這對於我進行視圖測試時尤其麻煩,因爲在我的控制檯中可能會渲染數百行標記。一點都不好玩。過多冗餘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行變成噪音。我怎樣才能省略它們?謝謝!

回答

1

我想你必須編寫自己的自定義格式程序。 documentation中的例子可能是以下信息,你想要什麼,但它應該給你一個開始。