Class: RSpec::Mocks::Implementation Private
Relationships & Source Files | |
Inherits: | Object |
Defined in: | rspec-mocks/lib/rspec/mocks/message_expectation.rb |
Overview
Represents a configured implementation. Takes into account any number of sub-implementations.
Other Constraints
- #actions private Internal use only
- #call(*args, &block) Internal use only
- #initial_action rw Internal use only
- #inner_action rw Internal use only
- #present? ⇒ Boolean readonly Internal use only
- #terminal_action rw Internal use only
Instance Attribute Details
#initial_action (rw)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 758
attr_accessor :initial_action, :inner_action, :terminal_action
#inner_action (rw)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 758
attr_accessor :initial_action, :inner_action, :terminal_action
#present? ⇒ Boolean
(readonly)
# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 767
def present? actions.any? end
#terminal_action (rw)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 758
attr_accessor :initial_action, :inner_action, :terminal_action
Instance Method Details
#actions (private)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 773
def actions [initial_action, inner_action, terminal_action].compact end
#call(*args, &block)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 760
def call(*args, &block) actions.map do |action| action.call(*args, &block) end.last end