123456789_123456789_123456789_123456789_123456789_

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

Other Constraints

Constructor Details

.new(method, block) ⇒ AndWrapOriginalImplementation

[ GitHub ]

  
# 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)

[ GitHub ]

  
# 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