Permalink
Browse files

Use with_connection to make request.

  • Loading branch information...
1 parent 48daae8 commit e58c9909895e0ea2e0096f8586d4ffcc763c6431 @i0rek committed Aug 22, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb
@@ -15,9 +15,11 @@ def http_request(method, uri, options = {}, &block)
:timeout => 25000
}
)
- hydra = Typhoeus::Hydra.new(:initial_pool_size => 0)
- hydra.queue(request)
- hydra.run
+ Typhoeus.with_connection {
+ hydra = Typhoeus::Hydra.new
+ hydra.queue(request)
+ hydra.run
+ }
response = request.response
raise FakeTyphoeusHydraTimeoutError.new if response.timed_out?
raise FakeTyphoeusHydraConnectError.new if response.code == 0

3 comments on commit e58c990

Owner

i0rek replied Oct 2, 2012

I think what @myronmarston said about vcr applies here too: i0rek/vcr@84fb704#commitcomment-1928493.

The with_connection block shouldn't be there.

I updated VCR based on typhoeus/typhoeus@0caa30b so that VCR now sets request.block_connection = false on individual requests rather than wrapping them in with_connection at the point the request is made, and that worked...but I started getting failures from the webmock specs when using typhoeus because the client still has to use with_connection when using typhoeus with WebMock as demonstrated here. I can't get a green VCR build until this is fixed.

Owner

i0rek replied Oct 4, 2012

I'll take care of that. Thanks for your effort!

Please sign in to comment.