Permalink
Browse files

It's only Typhoeus::Hydra that works. Typhoeus Easy and Multi are not…

… supported yet.
  • Loading branch information...
bblimke committed Nov 20, 2010
1 parent a849291 commit 764ad729a533f5004ac3f0dbd08d45653c55f1f9
View
@@ -10,7 +10,7 @@
require 'webmock/http_lib_adapters/patron'
require 'webmock/http_lib_adapters/curb'
require 'webmock/http_lib_adapters/em_http_request'
-require 'webmock/http_lib_adapters/typhoeus'
+require 'webmock/http_lib_adapters/typhoeus_hydra'
require 'webmock/errors'
@@ -4,7 +4,7 @@
module WebMock
module HttpLibAdapters
- class Typhoeus
+ class TyphoeusHydra
def self.build_request_signature(req)
uri = WebMock::Util::URI.heuristic_parse(req.url)
uri.path = uri.normalized_path.gsub("[^:]//","/")
@@ -72,14 +72,15 @@ class Hydra
def queue_with_webmock(request)
self.clear_stubs
request_signature =
- ::WebMock::HttpLibAdapters::Typhoeus.build_request_signature(request)
+ ::WebMock::HttpLibAdapters::TyphoeusHydra.build_request_signature(request)
::WebMock::RequestRegistry.instance.requested_signatures.put(request_signature)
if ::WebMock::StubRegistry.instance.registered_request?(request_signature)
webmock_response =
::WebMock::StubRegistry.instance.response_for_request(request_signature)
- ::WebMock::HttpLibAdapters::Typhoeus.stub_typhoeus(request_signature, webmock_response, self)
+ ::WebMock::HttpLibAdapters::TyphoeusHydra.
+ stub_typhoeus(request_signature, webmock_response, self)
webmock_response.raise_error_if_any
elsif !WebMock.net_connect_allowed?(request_signature.uri)
raise WebMock::NetConnectNotAllowedError.new(request_signature)
@@ -95,9 +96,9 @@ def queue_with_webmock(request)
Typhoeus::Hydra.after_request_before_on_complete do |request|
request_signature =
- ::WebMock::HttpLibAdapters::Typhoeus.build_request_signature(request)
+ ::WebMock::HttpLibAdapters::TyphoeusHydra.build_request_signature(request)
webmock_response =
- ::WebMock::HttpLibAdapters::Typhoeus.build_webmock_response(request.response)
+ ::WebMock::HttpLibAdapters::TyphoeusHydra.build_webmock_response(request.response)
if request.response.mock?
WebMock::CallbackRegistry.invoke_callbacks(
{:lib => :typhoeus},
@@ -2,13 +2,11 @@
require 'webmock_shared'
unless RUBY_PLATFORM =~ /java/
- require 'typhoeus_spec_helper'
+ require 'typhoeus_hydra_spec_helper'
- describe "Webmock with Typhoeus" do
- include TyphoeusSpecHelper
+ describe "Webmock with Typhoeus::Hydra" do
+ include TyphoeusHydraSpecHelper
it_should_behave_like "WebMock"
-
end
-
end
@@ -1,6 +1,6 @@
require 'ostruct'
-module TyphoeusSpecHelper
+module TyphoeusHydraSpecHelper
class FakeTyphoeusError < StandardError; end

0 comments on commit 764ad72

Please sign in to comment.