Class RR::SpyVerification
In: lib/rr/spy_verification.rb
Parent: Object

Methods

Included Modules

RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods RR::DoubleDefinitions::DoubleDefinition::ArgumentDefinitionConstructionMethods

Attributes

argument_expectation  [R] 
method_name  [R] 
subject  [RW] 
times_matcher  [R] 
times_matcher  [W] 

Public Class methods

[Source]

   # File lib/rr/spy_verification.rb, line 3
3:     def initialize(subject, method_name, args)
4:       @subject = subject
5:       @method_name = method_name.to_sym
6:       set_argument_expectation_for_args(args)
7:       @ordered = false
8:       once
9:     end

Public Instance methods

[Source]

    # File lib/rr/spy_verification.rb, line 26
26:     def call
27:       (error = RR.recorded_calls.match_error(self)) && raise(error)
28:     end

[Source]

    # File lib/rr/spy_verification.rb, line 17
17:     def ordered
18:       @ordered = true
19:       self
20:     end

[Source]

    # File lib/rr/spy_verification.rb, line 22
22:     def ordered?
23:       @ordered
24:     end

[Source]

    # File lib/rr/spy_verification.rb, line 30
30:     def to_proc
31:       lambda do
32:         call
33:       end
34:     end

Protected Instance methods

[Source]

    # File lib/rr/spy_verification.rb, line 44
44:     def install_method_callback(return_value_block)
45:       # Do nothing. This is to support DefinitionConstructionMethods
46:     end

[Source]

    # File lib/rr/spy_verification.rb, line 39
39:     def set_argument_expectation_for_args(args)
40:       # with_no_args and with actually set @argument_expectation
41:       args.empty? ? with_no_args : with(*args)
42:     end

[Validate]