Module: RSpec::Mocks::ObjectVerifyingDoubleMethods

Includes:
TestDouble, VerifyingDouble
Included in:
ClassVerifyingDouble, ObjectVerifyingDouble
Defined in:
lib/rspec/mocks/verifying_double.rb

Overview

An awkward module necessary because we cannot otherwise have ClassVerifyingDouble inherit from Module and still share these methods.

Instance Method Summary (collapse)

Methods included from VerifyingDouble

#__send__, #method_missing, #respond_to?, #send

Methods included from TestDouble

#==, #__disallow_further_usage!, #as_null_object, #freeze, #inspect, #null_object?, #respond_to?, #to_s

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RSpec::Mocks::VerifyingDouble

Instance Method Details

- (Object) __build_mock_proxy(order_group)



96
97
98
99
100
101
# File 'lib/rspec/mocks/verifying_double.rb', line 96

def __build_mock_proxy(order_group)
  VerifyingProxy.new(self, order_group,
    @doubled_module,
    ObjectMethodReference
  )
end

- (Object) as_stubbed_const(options = {})



103
104
105
106
# File 'lib/rspec/mocks/verifying_double.rb', line 103

def as_stubbed_const(options = {})
  ConstantMutator.stub(@doubled_module.const_to_replace, self, options)
  self
end

- (Object) initialize(doubled_module, *args)



91
92
93
94
# File 'lib/rspec/mocks/verifying_double.rb', line 91

def initialize(doubled_module, *args)
  @doubled_module = doubled_module
  super(doubled_module.description, *args)
end