Class: RSpec::Mocks::AnyInstance::StubChain Private
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
RSpec::Mocks::AnyInstance::ExpectChainChain, RSpec::Mocks::AnyInstance::StubChainChain
|
|
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Chain
|
|
|
Instance Chain:
self,
Chain,
Chain::Customizations
|
|
| Inherits: |
RSpec::Mocks::AnyInstance::Chain
|
| Defined in: | rspec-mocks/lib/rspec/mocks/any_instance/stub_chain.rb |
Constant Summary
-
EmptyInvocationOrder =
# File 'rspec-mocks/lib/rspec/mocks/any_instance/stub_chain.rb', line 38{}.freeze -
InvocationOrder =
# File 'rspec-mocks/lib/rspec/mocks/any_instance/stub_chain.rb', line 28{ :and_return => [:with, nil], :and_raise => [:with, nil], :and_yield => [:with, :and_yield, nil], :and_throw => [:with, nil], :and_call_original => [:with, nil], :and_wrap_original => [:with, nil] }.freeze
Class Method Summary
Instance Attribute Summary
Instance Method Summary
- #create_message_expectation_on(instance) private Internal use only
- #invocation_order private Internal use only
- #verify_invocation_order(rspec_method_name, *_args, &_block) private Internal use only
Chain - Inherited
| #constrained_to_any_of?, #expectation_fulfilled!, #matches_args?, #never, #playback!, #with, #last_message, #messages, #record |
Chain::Customizations - Included
| #and_call_original | Records the |
| #and_raise | Records the |
| #and_return | Records the |
| #and_throw | Records the |
| #and_wrap_original | Records the |
| #and_yield | Records the |
| #at_least | Records the |
| #at_most | Records the |
| #exactly | Records the |
| #never | Records the |
| #once | Records the |
| #thrice | Records the |
| #time | Records the |
| #times | Records the |
| #twice | Records the |
| #with | Records the |
Instance Attribute Details
#expectation_fulfilled? ⇒ Boolean (readonly)
# File 'rspec-mocks/lib/rspec/mocks/any_instance/stub_chain.rb', line 7
def expectation_fulfilled? true end
Instance Method Details
#create_message_expectation_on(instance) (private)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/any_instance/stub_chain.rb', line 13
def (instance) proxy = ::RSpec::Mocks.space.proxy_for(instance) method_name, opts = @expectation_args opts = (opts || {}).merge(:expected_form => IGNORED_BACKTRACE_LINE) stub = proxy.add_stub(method_name, opts, &@expectation_block) @recorder.stubs[stub.] << stub if RSpec::Mocks.configuration.yield_receiver_to_any_instance_implementation_blocks? stub.and_yield_receiver_to_implementation end stub end
#invocation_order (private)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/any_instance/stub_chain.rb', line 40
def invocation_order InvocationOrder end
#verify_invocation_order(rspec_method_name, *_args, &_block) (private)
# File 'rspec-mocks/lib/rspec/mocks/any_instance/stub_chain.rb', line 44
def verify_invocation_order(rspec_method_name, *_args, &_block) return if invocation_order.fetch(rspec_method_name, [nil]).include?() raise NoMethodError, "Undefined method #{rspec_method_name}" end