在测试环境rails s -e test
(我在开发模式下得到回溯。
它是谁,我该如何禁用它?我需要完整的回溯,而不仅仅是引发的错误!
我正在使用 Rails 3.2.3、Ruby 1.9.3、rspec、capybara、capybara-webkit
在测试环境rails s -e test
(我在开发模式下得到回溯。
它是谁,我该如何禁用它?我需要完整的回溯,而不仅仅是引发的错误!
我正在使用 Rails 3.2.3、Ruby 1.9.3、rspec、capybara、capybara-webkit
设置config.action_dispatch.show_exceptions = true
为test.rb
我做了诀窍。
env.rb
由 Cucumber 创建的读取:
# 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
会成功的。