Class: RSpec::Mocks::VerifyingProxy Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
TestDoubleProxy ,
Proxy
|
|
Instance Chain:
|
|
Inherits: |
RSpec::Mocks::TestDoubleProxy
|
Defined in: | rspec-mocks/lib/rspec/mocks/verifying_proxy.rb |
Overview
A verifying proxy mostly acts like a normal proxy, except that it contains extra logic to try and determine the validity of any expectation set on it. This includes whether or not methods have been defined and the validity of arguments on method calls.
In all other ways this behaves like a normal proxy. It only adds the verification behaviour to specific methods then delegates to the parent implementation.
These checks are only activated if the doubled class has already been loaded, otherwise they are disabled. This allows for testing in isolation.
Constant Summary
Proxy
- Inherited
Class Method Summary
- .new(object, order_group, doubled_module, method_reference_class) ⇒ VerifyingProxy constructor Internal use only
Proxy
- Inherited
Instance Attribute Summary
Proxy
- Inherited
Instance Method Summary
- #method_reference Internal use only
- #validate_arguments!(method_name, args) Internal use only
- #visibility_for(method_name) Internal use only
VerifyingProxyMethods
- Included
#add_message_expectation, #add_simple_stub, #add_stub, #ensure_implemented, #ensure_publicly_implemented |
TestDoubleProxy
- Inherited
Proxy
- Inherited
Instance Method Details
#method_reference
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 88
def method_reference @method_reference ||= Hash.new do |h, k| h[k] = @method_reference_class.for(@doubled_module, k) end end
#validate_arguments!(method_name, args)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 98
def validate_arguments!(method_name, args) @method_doubles[method_name].validate_arguments!(args) end
#visibility_for(method_name)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 94
def visibility_for(method_name) method_reference[method_name].visibility end