Class: RSpec::Mocks::VerifyingMethodDouble Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
RSpec::Mocks::VerifyingExistingClassNewMethodDouble, RSpec::Mocks::VerifyingExistingMethodDouble
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
MethodDouble
|
|
Instance Chain:
self,
MethodDouble
|
|
Inherits: |
RSpec::Mocks::MethodDouble
|
Defined in: | rspec-mocks/lib/rspec/mocks/verifying_proxy.rb |
Constant Summary
MethodDouble
- Inherited
Class Method Summary
- .new(object, method_name, proxy, method_reference) ⇒ VerifyingMethodDouble constructor Internal use only
MethodDouble
- Inherited
Instance Attribute Summary
MethodDouble
- Inherited
Instance Method Summary
- #add_expectation(*args, &block) Internal use only
- #add_stub(*args, &block) Internal use only
- #message_expectation_class Internal use only
- #proxy_method_invoked(obj, *args, &block) Internal use only
- #validate_arguments!(actual_args) Internal use only
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 |
Instance Method Details
#add_expectation(*args, &block)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 149
def add_expectation(*args, &block) # explicit params necessary for 1.8.7 see #626 super(*args, &block).tap { |x| x.method_reference = @method_reference } end
#add_stub(*args, &block)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 154
def add_stub(*args, &block) # explicit params necessary for 1.8.7 see #626 super(*args, &block).tap { |x| x.method_reference = @method_reference } end
#message_expectation_class
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 145
def VerifyingMessageExpectation end
#proxy_method_invoked(obj, *args, &block)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 159
def proxy_method_invoked(obj, *args, &block) validate_arguments!(args) super end
#validate_arguments!(actual_args)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 165
def validate_arguments!(actual_args) @method_reference.with_signature do |signature| verifier = Support::StrictSignatureVerifier.new(signature, actual_args) raise ArgumentError, verifier. unless verifier.valid? end end