class Mocha::ParameterMatchers::EquivalentUri

Parameter matcher which matches URIs with equivalent query strings.

def explode(uri)

Other tags:
    Private: -
def explode(uri)
  query_hash = CGI.parse(uri.query || '')
  URI::Generic::COMPONENT.inject({}) { |h, k| h.merge(k => uri.__send__(k)) }.merge(query: query_hash)
end

def initialize(uri)

Other tags:
    Private: -
def initialize(uri)
  @uri = URI.parse(uri)
end

def matches?(available_parameters)

Other tags:
    Private: -
def matches?(available_parameters)
  actual = explode(URI.parse(available_parameters.shift))
  expected = explode(@uri)
  actual == expected
end

def mocha_inspect

Other tags:
    Private: -
def mocha_inspect
  "equivalent_uri(#{@uri.mocha_inspect})"
end