Browse files

Use with_connection to make request.

  • Loading branch information...
1 parent 48daae8 commit e58c9909895e0ea2e0096f8586d4ffcc763c6431 @i0rek i0rek committed Aug 22, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb
View
8 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

0 comments on commit e58c990

Please sign in to comment.