當我運行任何失敗的RSpec測試時,我收到很多我不太瞭解的消息。RSpec詳細錯誤消息
舉例來說,假設我跑:
expect(true).to be_false
然後我的控制檯獲取與信息充斥着#
Failures:
1) Some test
Failure/Error: expect(true).to be_false
expected true to respond to `false?`
# ./spec/controllers/wing_relationships_controller_spec.rb:43:in `block (3 levels) in <top (required)>'
# /Users/mac/.rvm/gems/[email protected]/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:241:in `load'
# /Users/mac/.rvm/gems/[email protected]/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:241:in `block in load'
# /Users/mac/.rvm/gems/[email protected]/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:in `load_dependency'
# /Users/mac/.rvm/gems/[email protected]/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:241:in `load'
# /Users/mac/.rvm/gems/[email protected]/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:241:in `load'
# /Users/mac/.rvm/gems/[email protected]/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:241:in `block in load'
# /Users/mac/.rvm/gems/[email protected]/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:in `load_dependency'
# /Users/mac/.rvm/gems/[email protected]/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:241:in `load'
# -e:1:in `<main>'
錯誤信息經常變化的開始,而有時則是非常長的。
當我運行很多測試時,很難讀取結果。我想擺脫那些。有什麼建議麼?我已經關閉了RSpec中的--warning
我想修復錯誤,但錯誤信息是不可理解的。看起來他們只是列出了一堆沒有指示的路徑。有任何解決這個問題的方法嗎? – 2014-10-19 03:58:32
沒有太多上下文很難。但是嘗試隔離失敗的測試,只運行你感興趣的期望,而不是整個測試套件。嘗試瞭解您是否需要正確的文件依賴關係,然後再次打開警告。如果您仍然卡住,請嘗試發佈文件的要點。 – Barbared 2014-10-19 10:27:58