This PR makes webmock work with the upcoming typhoeus release. One of the interesting things is, that the monkey patch is gone.
One thing that still needs to be addressed is that there is now more than one way to do a request. request.run no longer uses the hydra. Basically all tests must be run with hydra.run and request.run. The reason I'm not extremely concerned that everything breaks for request.run is that the before hook is quite simple and do exist for both of course.
Use typhoeus master.
Use with_connection to make request.
User response#header instead of headers_hash.
Create hydra and clear expectations upfront.
Use provided hydra.
Use global callbacks instead global_hooks.
Some minor changes.
Use global stub method.
I dunno what that was for.
Use before hook instead Typhoeus' stubs.
Remove no longer used method.
Use response#headers instead header.
Awesome, no monkey patching! Can't wait to merge it :)
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.
request.block_connection = false
I'll take care of that. Thanks for your effort!
Don't use with_connection.
Done! All green.
@i0rek -- Thanks, I'll take a stab at integrating your work into VCR master this week.
@bblimke Typhoeus 0.5 is released: https://rubygems.org/gems/typhoeus.
@i0rek awesome. congrats! I just released WebMock 1.9.0 with your pull request merged in. Cheers.