Skip to content

Commit

Permalink
Merge pull request #178 from HendrikW/master
Browse files Browse the repository at this point in the history
Net:HTTP adapter tries to close connection two times and throws error
  • Loading branch information
bblimke committed Jul 23, 2012
2 parents 1e61a8c + aaa5bf2 commit 36aff46
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/webmock/http_lib_adapters/net_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@ def request_with_webmock(request, body = nil, &block)
end
response = if (started? && !WebMock::Config.instance.net_http_connect_on_start) || !started?
@started = false #otherwise start_with_connect wouldn't execute and connect
start_with_connect {
response = request_without_webmock(request, nil)
after_request.call(response)
}
start_with_connect
response = request_without_webmock(request, nil)
after_request.call(response)
else
response = request_without_webmock(request, nil)
after_request.call(response)
Expand Down

0 comments on commit 36aff46

Please sign in to comment.