Class: RSpec::Mocks::VerifyingPartialDoubleProxy

Inherits:
PartialDoubleProxy show all
Includes:
VerifyingProxyMethods
Defined in:
lib/rspec/mocks/verifying_proxy.rb

Direct Known Subclasses

VerifyingPartialClassDoubleProxy

Instance Attribute Summary

Attributes inherited from Proxy

#object

Instance Method Summary (collapse)

Methods included from VerifyingProxyMethods

#add_message_expectation, #add_simple_stub, #add_stub, #ensure_implemented, #ensure_publicly_implemented

Methods inherited from PartialDoubleProxy

#add_simple_expectation, #add_simple_stub, #original_method_handle_for, #reset, #visibility_for

Methods inherited from Proxy

#add_message_expectation, #add_simple_expectation, #add_simple_stub, #add_stub, #as_null_object, #build_expectation, #check_for_unexpected_arguments, #has_negative_expectation?, #message_received, #null_object?, #original_method_handle_for, #prepended_modules_of_singleton_class, #raise_missing_default_stub_error, #raise_unexpected_message_args_error, #raise_unexpected_message_error, #received_message?, #record_message_received, #remove_stub, #remove_stub_if_present, #replay_received_message_on, #reset, #verify, #visibility_for

Constructor Details

- (VerifyingPartialDoubleProxy) initialize(object, expectation_ordering)

Returns a new instance of VerifyingPartialDoubleProxy



89
90
91
92
93
94
95
96
97
98
# File 'lib/rspec/mocks/verifying_proxy.rb', line 89

def initialize(object, expectation_ordering)
  super(object, expectation_ordering)
  @doubled_module = DirectObjectReference.new(object)

  # A custom method double is required to pass through a way to lookup
  # methods to determine their parameters.
  @method_doubles = Hash.new do |h, k|
    h[k] = VerifyingExistingMethodDouble.new(object, k, self)
  end
end

Instance Method Details

- (Object) method_reference



100
101
102
# File 'lib/rspec/mocks/verifying_proxy.rb', line 100

def method_reference
  @method_doubles
end