Class: Mocha::ParameterMatchers::YamlEquivalent

Inherits:
Base
  • Object
show all
Defined in:
lib/mocha/parameter_matchers/yaml_equivalent.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Base

#&, #to_matcher, #|

Constructor Details

#initialize(object) ⇒ YamlEquivalent

Returns a new instance of YamlEquivalent.



26
27
28
# File 'lib/mocha/parameter_matchers/yaml_equivalent.rb', line 26

def initialize(object)
  @object = object
end

Instance Method Details

#matches?(available_parameters) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
33
# File 'lib/mocha/parameter_matchers/yaml_equivalent.rb', line 30

def matches?(available_parameters)
  parameter = available_parameters.shift
  @object == YAML.load(parameter)
end

#mocha_inspectObject



35
36
37
# File 'lib/mocha/parameter_matchers/yaml_equivalent.rb', line 35

def mocha_inspect
  "yaml_equivalent(#{@object.mocha_inspect})"
end