class Mocha::ParameterMatchers::HasKey
Parameter matcher which matches when actual parameter contains Hash
entry with expected key.
def initialize(key)
- Private: -
def initialize(key) @key = key end
def matches?(available_parameters)
- 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
- Private: -
def mocha_inspect "has_key(#{@key.mocha_inspect})" end