class Mocha::ParameterMatchers::EquivalentUri
Parameter matcher which matches URIs with equivalent query strings.
def explode(uri)
- 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)
- Private: -
def initialize(uri) @uri = URI.parse(uri) end
def matches?(available_parameters)
- Private: -
def matches?(available_parameters) actual = explode(URI.parse(available_parameters.shift)) expected = explode(@uri) actual == expected end
def mocha_inspect
- Private: -
def mocha_inspect "equivalent_uri(#{@uri.mocha_inspect})" end