Class: Mocha::ParameterMatchers::RespondsWith
- Defined in:
- lib/mocha/parameter_matchers/responds_with.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(message, result) ⇒ RespondsWith
constructor
A new instance of RespondsWith.
- #matches?(available_parameters) ⇒ Boolean
- #mocha_inspect ⇒ Object
Methods inherited from Base
#&, #to_matcher, #|
Constructor Details
#initialize(message, result) ⇒ RespondsWith
Returns a new instance of RespondsWith.
26 27 28 |
# File 'lib/mocha/parameter_matchers/responds_with.rb', line 26 def initialize(, result) @message, @result = , result end |
Instance Method Details
#matches?(available_parameters) ⇒ Boolean
30 31 32 33 |
# File 'lib/mocha/parameter_matchers/responds_with.rb', line 30 def matches?(available_parameters) parameter = available_parameters.shift parameter.__send__(@message) == @result end |
#mocha_inspect ⇒ Object
35 36 37 |
# File 'lib/mocha/parameter_matchers/responds_with.rb', line 35 def mocha_inspect "responds_with(#{@message.mocha_inspect}, #{@result.mocha_inspect})" end |