class RR::SpyVerification
Attributes
argument_expectation[R]
method_name[R]
subject[RW]
times_matcher[RW]
Public Class Methods
new(subject, method_name, args)
click to toggle source
# File lib/rr/spy_verification.rb, line 3 def initialize(subject, method_name, args) @subject = subject @method_name = method_name.to_sym set_argument_expectation_for_args(args) @ordered = false once end
Public Instance Methods
call()
click to toggle source
# File lib/rr/spy_verification.rb, line 26 def call (error = RR.recorded_calls.match_error(self)) && raise(error) end
ordered()
click to toggle source
# File lib/rr/spy_verification.rb, line 17 def ordered @ordered = true self end
ordered?()
click to toggle source
# File lib/rr/spy_verification.rb, line 22 def ordered? @ordered end
subject_inspect()
click to toggle 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
to_proc()
click to toggle source
# File lib/rr/spy_verification.rb, line 30 def to_proc lambda do call end end
Protected Instance Methods
install_method_callback(return_value_block)
click to toggle source
# File lib/rr/spy_verification.rb, line 52 def install_method_callback(return_value_block) # Do nothing. This is to support DefinitionConstructionMethods end
set_argument_expectation_for_args(args)
click to toggle source
# File lib/rr/spy_verification.rb, line 47 def set_argument_expectation_for_args(args) # with_no_args and with actually set @argument_expectation args.empty? ? with_no_args : with(*args) end