提交 7fb53697 编写于 作者: C Carlos Antonio da Silva

Add ensure block to make sure the state is properly restored

上级 1fef1bed
......@@ -28,7 +28,7 @@ def initialize(app, exceptions_app)
def call(env)
begin
response = @app.call(env)
response = @app.call(env)
rescue Exception => exception
raise exception if env['action_dispatch.show_exceptions'] == false
end
......
......@@ -104,7 +104,7 @@ def test_render_failsafe_exception
get '/', {}, 'HTTP_ACCEPT' => 'text/json'
assert_response :internal_server_error
assert_equal 'text/plain', response.content_type.to_s
ensure
@app.instance_variable_set(:@exceptions_app, @exceptions_app)
$stderr = STDERR
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册