class RR::SpyVerification
Attributes
Public Class Methods
Source
# File lib/rr/spy_verification.rb, line 3 def initialize(subject, method_name, args, kwargs) @subject = subject @method_name = method_name.to_sym set_argument_expectation_for_args(args, kwargs) @ordered = false once end
Public Instance Methods
Source
# File lib/rr/spy_verification.rb, line 26 def call (error = RR.recorded_calls.match_error(self)) && raise(error) end
Source
# File lib/rr/spy_verification.rb, line 36 def subject_inspect if subject.respond_to?(:__rr__original_inspect, true) subject.__rr__original_inspect else subject.inspect end end
Protected Instance Methods
Source
# File lib/rr/spy_verification.rb, line 60 def install_method_callback(return_value_block) # Do nothing. This is to support DefinitionConstructionMethods end
Source
# File lib/rr/spy_verification.rb, line 47 def set_argument_expectation_for_args(args, kwargs) if args.empty? and kwargs.empty? # with_no_args and with actually set @argument_expectation with_no_args else if KeywordArguments.fully_supported? with(*args, **kwargs) else with(*args) end end end