lib/rack/mock.rb in rack-1.3.0 vs lib/rack/mock.rb in rack-1.3.1
- old
+ new
@@ -66,10 +66,13 @@
else
app = @app
end
errors = env["rack.errors"]
- MockResponse.new(*(app.call(env) + [errors]))
+ status, headers, body = app.call(env)
+ MockResponse.new(status, headers, body, errors)
+ ensure
+ body.close if body.respond_to?(:close)
end
# Return the Rack environment used for a request to +uri+.
def self.env_for(uri="", opts={})
uri = URI(uri)