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