Class: RSpec::Mocks::AndWrapOriginalImplementation Private
Relationships & Source Files | |
Inherits: | Object |
Defined in: | rspec-mocks/lib/rspec/mocks/message_expectation.rb |
Overview
Represents an and_call_original
implementation.
Constant Summary
-
CannotModifyFurtherError =
# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 786Class.new(StandardError)
Other Constraints
- #call(*args, &block) Internal use only
- #cannot_modify_further_error private Internal use only
- #initial_action=(_value) writeonly Internal use only
- #inner_action rw Internal use only
- #inner_action=(_value) rw Internal use only
- .new(method, block) ⇒ AndWrapOriginalImplementation constructor Internal use only
- #present? ⇒ Boolean readonly Internal use only
- #terminal_action=(_value) writeonly Internal use only
Constructor Details
.new(method, block) ⇒ AndWrapOriginalImplementation
# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 781
def initialize(method, block) @method = method @block = block end
Instance Attribute Details
#initial_action=(_value) (writeonly)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 788
def initial_action=(_value) raise cannot_modify_further_error end
#inner_action (rw)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 804
def inner_action true end
#inner_action=(_value) (rw)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 792
def inner_action=(_value) raise cannot_modify_further_error end
#present? ⇒ Boolean
(readonly)
# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 800
def present? true end
#terminal_action=(_value) (writeonly)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 796
def terminal_action=(_value) raise cannot_modify_further_error end
Instance Method Details
#call(*args, &block)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 808
def call(*args, &block) @block.call(@method, *args, &block) end
#cannot_modify_further_error (private)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/message_expectation.rb', line 815
def cannot_modify_further_error CannotModifyFurtherError.new "This method has already been configured " \ "to call the original implementation, and cannot be modified further." end