module Typhoeus::ClassMethods
def get_mock(method, url, options)
def get_mock(method, url, options) return nil unless @remote_mocks if @remote_mocks.has_key? method extra_response_args = { :requested_http_method => method, :requested_url => url, :start_time => Time.now } mock_key = mock_key_for(url, options[:params]) if @remote_mocks[method].has_key? mock_key get_mock_and_run_handlers(method, @remote_mocks[method][mock_key].merge( extra_response_args), options) elsif @remote_mocks[method].has_key? :catch_all get_mock_and_run_handlers(method, @remote_mocks[method][:catch_all].merge( extra_response_args), options) else nil end else nil end end