Methods

Class/Module Index [+]

Quicksearch

RSpec::Mocks::VerifyingMessageExpectation

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. @api private

Attributes

method_reference[RW]

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.

Public Class Methods

new(*args) click to toggle source
# File lib/rspec/mocks/verifying_message_expecation.rb, line 22
def initialize(*args)
  super
end

Public Instance Methods

with(*args, &block) click to toggle source

@private

# File lib/rspec/mocks/verifying_message_expecation.rb, line 27
def with(*args, &block)
  unless ArgumentMatchers::AnyArgsMatcher === args.first
    expected_args = if ArgumentMatchers::NoArgsMatcher === args.first
      []
    elsif args.length > 0
      args
    else
      # No arguments given, this will raise.
      super
    end

    validate_arguments!(expected_args)
  end
  super
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.