Parent

Class/Module Index [+]

Quicksearch

Typhoeus::Hydra

Public Instance Methods

clear_webmock_stubs() click to toggle source
# File lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb, line 170
def clear_webmock_stubs
  self.stubs = [] unless self.stubs
  self.stubs.delete_if {|s|
    s.instance_variable_get(:@options)[:webmock_stub]
  }
end
queue(request) click to toggle source
Also aliased as: queue_without_webmock
Alias for: queue_with_webmock
queue_with_webmock(request) click to toggle source
# File lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb, line 145
def queue_with_webmock(request)
  self.clear_webmock_stubs

  if WebMock::HttpLibAdapters::TyphoeusAdapter.disabled?
    return queue_without_webmock(request)
  end

  request_signature =
   ::WebMock::HttpLibAdapters::TyphoeusAdapter.build_request_signature(request)

  ::WebMock::RequestRegistry.instance.requested_signatures.put(request_signature)

  if webmock_response = ::WebMock::StubRegistry.instance.response_for_request(request_signature)
    ::WebMock::HttpLibAdapters::TyphoeusAdapter.
      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)
  end
  queue_without_webmock(request)
end
Also aliased as: queue
queue_without_webmock(request) click to toggle source
Alias for: queue

[Validate]

Generated with the Darkfish Rdoc Generator 2.