簡體   English   中英

如何在Rails測試環境中獲得完整的堆棧跟蹤,而不是“處理請求時發生意外錯誤”?

[英]How do I get a full stack trace instead of “Unexpected error while processing request” in Rails test environment?

在測試環境( rails s -e test )中啟動我的Rails服務器時,某些東西正在搶救異常並輸出“處理請求時出現意外錯誤:...此處錯誤...”。 我在開發模式中得到了回溯。

是誰,如何禁用它? 我需要完整的回溯,而不僅僅是引發的錯誤!

我正在使用Rails 3.2.3,Ruby 1.9.3,rspec,capybara,capybara-webkit

test.rb設置config.action_dispatch.show_exceptions = true對我test.rb

閱讀由Cucumber創建的env.rb

# By default, any exception happening in your Rails application will bubble up
# to Cucumber so that your scenario will fail. This is a different from how 
# your application behaves in the production environment, where an error page will 
# be rendered instead.
...
# 1) Tag your scenario (or feature) with @allow-rescue
# 2) Set the value below to true. Beware that doing this globally is not
# recommended as it will mask a lot of errors for you!

摘要:

@allow-rescue
Feature: blah blah blah

會成功的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM