class Faraday::Adapter::Test::Stubs

def new_stub(request_method, path, headers = {}, body = nil, &block)

def new_stub(request_method, path, headers = {}, body = nil, &block)
  normalized_path, host =
    if path.is_a?(Regexp)
      path
    else
      [
        Faraday::Utils.normalize_path(path),
        Faraday::Utils.URI(path).host
      ]
    end
  path, query = normalized_path.respond_to?(:split) ? normalized_path.split('?') : normalized_path
  headers = Utils::Headers.new(headers)
  stub = Stub.new(host, path, query, headers, body, @strict_mode, block)
  (@stack[request_method] ||= []) << stub
end