Class: RSpec::Mocks::MessageChain Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
RSpec::Mocks::ExpectChain, RSpec::Mocks::StubChain
|
|
Inherits: | Object |
Defined in: | rspec-mocks/lib/rspec/mocks/message_chain.rb |
Class Method Summary
- .new(object, *chain, &blk) ⇒ MessageChain constructor Internal use only
Instance Attribute Summary
Instance Method Summary
- #setup_chain Internal use only
- #chain_on(object, *chain, &block) private Internal use only
- #find_matching_expectation private Internal use only
- #find_matching_stub private Internal use only
- #format_chain(*chain, &blk) private Internal use only
Instance Attribute Details
#block (readonly)
[ GitHub ]#chain (readonly)
[ GitHub ]#object (readonly)
[ GitHub ]Instance Method Details
#chain_on(object, *chain, &block) (private)
[ GitHub ]#find_matching_expectation (private)
[ GitHub ]#find_matching_stub (private)
[ GitHub ]#format_chain(*chain, &blk) (private)
[ GitHub ]#setup_chain
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/message_chain.rb', line 13
def setup_chain if chain.length > 1 if (matching_stub = find_matching_stub) chain.shift chain_on(matching_stub.invoke(nil), *chain, &@block) elsif (matching_expectation = find_matching_expectation) chain.shift chain_on(matching_expectation.invoke_without_incrementing_received_count(nil), *chain, &@block) else next_in_chain = Double.new expectation(object, chain.shift) { next_in_chain } chain_on(next_in_chain, *chain, &@block) end else expectation(object, chain.shift, &@block) end end