class Faraday::Adapter::Test::Stub

def matches?(env)

Parameters:
  • env (Faraday::Env) --
def matches?(env)
  request_host = env[:url].host
  request_path = Faraday::Utils.normalize_path(env[:url].path)
  request_headers = env.request_headers
  request_body = env[:body]
  # meta is a hash used as carrier
  # that will be yielded to consumer block
  meta = {}
  [(host.nil? || host == request_host) &&
    path_match?(request_path, meta) &&
    params_match?(env) &&
    (body.to_s.size.zero? || request_body == body) &&
    headers_match?(request_headers), meta]
end