class Mocha::ParameterMatchers::HasKey

Parameter matcher which matches when actual parameter contains Hash entry with expected key.

def initialize(key)

Other tags:
    Private: -
def initialize(key)
  @key = key
end

def matches?(available_parameters)

Other tags:
    Private: -
def matches?(available_parameters)
  parameter = available_parameters.shift
  return false unless parameter.respond_to?(:keys)
  parameter.keys.any? { |key| @key.to_matcher.matches?([key]) }
end

def mocha_inspect

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