Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Swap the order of arguments to on_body callbacks.

  • Loading branch information...
commit d7ba07ddb1c0967d6e4c382ab653a5773ad3c71f 1 parent 4c6a821
@spraints spraints authored
View
2  lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb
@@ -145,7 +145,7 @@ def self.request_hash(request_signature)
response = ::WebMock::HttpLibAdapters::TyphoeusAdapter.generate_typhoeus_response(request_signature, webmock_response)
if request.respond_to?(:streaming?) && request.streaming?
response.options[:response_body] = ""
- request.on_body.each { |callback| callback.call(response, webmock_response.body) }
+ request.on_body.each { |callback| callback.call(webmock_response.body, response) }
end
request.finish(response)
webmock_response.raise_error_if_any
View
2  spec/acceptance/typhoeus/typhoeus_hydra_spec.rb
@@ -86,7 +86,7 @@
test_body = nil
test_complete = nil
pending("This test requires a newer version of Typhoeus") unless @request.respond_to?(:on_body)
- @request.on_body do |response, body|
+ @request.on_body do |body, response|
test_body = body
end
@request.on_complete do |response|
Please sign in to comment.
Something went wrong with that request. Please try again.