Class: RSpec::Mocks::VerifyingMessageExpectation Private

Inherits:
MessageExpectation
  • Object
show all
Defined in:
lib/rspec/mocks/verifying_message_expecation.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A message expectation that knows about the real implementation of the message being expected, so that it can verify that any expectations have the valid arguments.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (VerifyingMessageExpectation) initialize(*args)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of VerifyingMessageExpectation

20
21
22
# File 'lib/rspec/mocks/verifying_message_expecation.rb', line 20
def initialize(*args)
  super
end

Instance Attribute Details

- (Object) method_reference

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

A level of indirection is used here rather than just passing in the method itself, since method look up is expensive and we only want to do it if actually needed.

Conceptually the method reference makes more sense as a constructor argument since it should be immutable, but it is significantly more straight forward to build the object in pieces so for now it stays as an accessor.

18
19
20
# File 'lib/rspec/mocks/verifying_message_expecation.rb', line 18
def method_reference
  @method_reference
end