问题
I am using Capybara in combination with rspec for integration testing of rails apps.
I would like any errors (routing errors, errors in a controller, anything) generated during a test to be printed the same as "puts" statements in rspec's output. Is this possible? Additionally, is this a reasonable idea, or am I just being silly?
回答1:
Adding the following to my spec_helper.rb file worked:
ActionController::Base.class_eval do
def rescue_action(exception)
raise exception
end
end
来源:https://stackoverflow.com/questions/8524839/sending-rails-errors-to-rspec-output