Permalink
Browse files

Merge pull request #178 from HendrikW/master

Net:HTTP adapter tries to close connection two times and throws error
  • Loading branch information...
2 parents 1e61a8c + aaa5bf2 commit 36aff464f7f4a95dd82a17c6954bc1160a6e83a1 @bblimke committed Jul 23, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/webmock/http_lib_adapters/net_http.rb
@@ -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)

0 comments on commit 36aff46

Please sign in to comment.