class Mocha::ParameterMatchers::RespondsWith
Parameter matcher which matches if actual parameter returns expected result when specified method is invoked.
Public Class Methods
new(message, result)
click to toggle source
@private
# File lib/mocha/parameter_matchers/responds_with.rb, line 35 def initialize(message, result) @message, @result = message, result end
Public Instance Methods
matches?(available_parameters)
click to toggle source
@private
# File lib/mocha/parameter_matchers/responds_with.rb, line 40 def matches?(available_parameters) parameter = available_parameters.shift @result.to_matcher.matches?( [parameter.__send__(@message)] ) end
mocha_inspect()
click to toggle source
@private
# File lib/mocha/parameter_matchers/responds_with.rb, line 46 def mocha_inspect "responds_with(#{@message.mocha_inspect}, #{@result.mocha_inspect})" end