Class: RSpec::Mocks::VerifyingExistingMethodDouble Private
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
RSpec::Mocks::VerifyingExistingClassNewMethodDouble
|
|
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
|
|
|
Instance Chain:
|
|
| Inherits: |
RSpec::Mocks::VerifyingMethodDouble
|
| Defined in: | rspec-mocks/lib/rspec/mocks/verifying_proxy.rb |
Overview
A VerifyingMethodDouble fetches the method to verify against from the original object, using a MethodReference. This works for pure doubles, but when the original object is itself the one being modified we need to collapse the reference and the method double into a single object so that we can access the original pristine method definition.
Constant Summary
MethodDouble - Inherited
Class Method Summary
- .for(object, method_name, proxy) Internal use only
- .new(object, method_name, proxy) ⇒ VerifyingExistingMethodDouble constructor Internal use only
VerifyingMethodDouble - Inherited
MethodDouble - Inherited
Instance Attribute Summary
- #unimplemented? ⇒ Boolean readonly Internal use only
MethodDouble - Inherited
Instance Method Summary
- #with_signature {|Support::MethodSignature.new(original_implementation_callable)| ... } Internal use only
VerifyingMethodDouble - Inherited
| #add_expectation, #add_stub, #message_expectation_class, #proxy_method_invoked, #validate_arguments! |
MethodDouble - Inherited
| #add_default_stub, #add_expectation, #add_simple_expectation, | |
| #add_simple_stub | A simple stub can only return a concrete value for a message, and cannot match on arguments. |
| #add_stub, #build_expectation, #clear, #configure_method, #define_proxy_method, | |
| #message_expectation_class | The type of message expectation to create has been extracted to its own method so that subclasses can override it. |
| #method_missing_block, #object_singleton_class, #original_implementation_callable, #original_method, | |
| #proxy_method_invoked | The implementation of the proxied method. |
| #raise_method_not_stubbed_error, #remove_stub, #remove_stub_if_present, #reset, #restore_original_method, #restore_original_visibility, | |
| #save_original_implementation_callable! | |
| #setup_simple_method_double, #show_frozen_warning, #verify, #visibility, | |
| #definition_target | See additional method definition at line 255. |
| #new_rspec_prepended_module, #remove_method_from_definition_target, #usable_rspec_prepended_module | |
Class Method Details
.for(object, method_name, proxy)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 199
def self.for(object, method_name, proxy) if ClassNewMethodReference.applies_to?(method_name) { object } VerifyingExistingClassNewMethodDouble elsif Mocks.configuration.temporarily_suppress_partial_double_verification MethodDouble else self end.new(object, method_name, proxy) end
Instance Attribute Details
#unimplemented? ⇒ Boolean (readonly)
# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 195
def unimplemented? !@valid_method end
Instance Method Details
#with_signature {|Support::MethodSignature.new(original_implementation_callable)| ... }
# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 191
def with_signature yield Support::MethodSignature.new(original_implementation_callable) end