Class: RSpec::Mocks::PartialDoubleProxy Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
RSpec::Mocks::PartialClassDoubleProxy, RSpec::Mocks::ProxyForNil, RSpec::Mocks::VerifyingPartialClassDoubleProxy, RSpec::Mocks::VerifyingPartialDoubleProxy
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Proxy
|
|
Instance Chain:
self,
Proxy
|
|
Inherits: |
RSpec::Mocks::Proxy
|
Defined in: | rspec-mocks/lib/rspec/mocks/proxy.rb |
Constant Summary
Proxy
- Inherited
Class Method Summary
Proxy
- Inherited
Instance Attribute Summary
Proxy
- Inherited
Instance Method Summary
- #add_simple_expectation(method_name, response, location) Internal use only
- #add_simple_stub(method_name, response) Internal use only
- #message_received(message, *args, &block) Internal use only
- #original_method_handle_for(message) Internal use only
- #reset Internal use only
- #visibility_for(method_name) Internal use only
- #any_instance_class_recorder_observing_method?(klass, method_name) ⇒ Boolean private Internal use only
Proxy
- Inherited
Instance Method Details
#add_simple_expectation(method_name, response, location)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/proxy.rb', line 331
def add_simple_expectation(method_name, response, location) method_double_for(method_name).configure_method super end
#add_simple_stub(method_name, response)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/proxy.rb', line 337
def add_simple_stub(method_name, response) method_double_for(method_name).configure_method super end
#any_instance_class_recorder_observing_method?(klass, method_name) ⇒ Boolean
(private)
# File 'rspec-mocks/lib/rspec/mocks/proxy.rb', line 364
def any_instance_class_recorder_observing_method?(klass, method_name) only_return_existing = true recorder = ::RSpec::Mocks.space.any_instance_recorder_for(klass, only_return_existing) return true if recorder && recorder.already_observing?(method_name) superklass = klass.superclass return false if superklass.nil? any_instance_class_recorder_observing_method?(superklass, method_name) end
#message_received(message, *args, &block)
[ GitHub ]#original_method_handle_for(message)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/proxy.rb', line 318
def original_method_handle_for( ) if any_instance_class_recorder_observing_method?(@object.class, ) = ::RSpec::Mocks.space. any_instance_recorder_for(@object.class). build_alias_method_name( ) end ::RSpec::Support.method_handle_for(@object, ) rescue NameError nil end
#reset
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/proxy.rb', line 349
def reset @method_doubles.each_value { |d| d.reset } super end
#visibility_for(method_name)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/proxy.rb', line 343
def visibility_for(method_name) # We fall back to :public because by default we allow undefined methods # to be stubbed, and when we do so, we make them public. MethodReference.method_visibility_for(@object, method_name) || :public end