Class: RSpec::Mocks::ProxyForNil Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
PartialDoubleProxy ,
Proxy
|
|
Instance Chain:
self,
PartialDoubleProxy ,
Proxy
|
|
Inherits: |
RSpec::Mocks::PartialDoubleProxy
|
Defined in: | rspec-mocks/lib/rspec/mocks/proxy.rb |
Constant Summary
Proxy
- Inherited
Class Method Summary
- .new(order_group) ⇒ ProxyForNil constructor Internal use only
Proxy
- Inherited
Instance Attribute Summary
- #disallow_expectations rw Internal use only
- #warn_about_expectations rw Internal use only
Proxy
- Inherited
Instance Method Summary
- #add_message_expectation(method_name, opts = {}, &block) Internal use only
- #add_stub(method_name, opts = {}, &implementation) Internal use only
- #raise_error(method_name) private Internal use only
- #set_expectation_behavior private Internal use only
- #warn(method_name) private Internal use only
- #warn_or_raise!(method_name) private Internal use only
PartialDoubleProxy
- Inherited
#add_simple_expectation, #add_simple_stub, #message_received, #original_method_handle_for, #reset, #visibility_for, #any_instance_class_recorder_observing_method? |
Proxy
- Inherited
Instance Attribute Details
#disallow_expectations (rw)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/proxy.rb', line 467
attr_accessor :disallow_expectations
#warn_about_expectations (rw)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/proxy.rb', line 468
attr_accessor :warn_about_expectations
Instance Method Details
#add_message_expectation(method_name, opts = {}, &block)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/proxy.rb', line 470
def (method_name, opts={}, &block) warn_or_raise!(method_name) super end
#add_stub(method_name, opts = {}, &implementation)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/proxy.rb', line 475
def add_stub(method_name, opts={}, &implementation) warn_or_raise!(method_name) super end
#raise_error(method_name) (private)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/proxy.rb', line 512
def raise_error(method_name) @error_generator.raise_expectation_on_nil_error(method_name) end
#set_expectation_behavior (private)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/proxy.rb', line 482
def set_expectation_behavior case RSpec::Mocks.configuration. when false @warn_about_expectations = false @disallow_expectations = true when true @warn_about_expectations = false @disallow_expectations = false else @warn_about_expectations = true @disallow_expectations = false end end
#warn(method_name) (private)
[ GitHub ]#warn_or_raise!(method_name) (private)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/proxy.rb', line 496
def warn_or_raise!(method_name) # This method intentionally swallows the message when # neither disallow_expectations nor warn_about_expectations # are set to true. if disallow_expectations raise_error(method_name) elsif warn_about_expectations warn(method_name) end end