class RSpec::Mocks::AnyInstance::NegativeExpectationChain

@api private

Public Class Methods

new(*args, &block) click to toggle source
# File lib/rspec/mocks/any_instance/expectation_chain.rb, line 40
def initialize(*args, &block)
  super(:should_not_receive, *args, &block)
end

Public Instance Methods

expectation_fulfilled?() click to toggle source

`should_not_receive` causes a failure at the point in time the message is wrongly received, rather than during `rspec_verify` at the end of an example. Thus, we should always consider a negative expectation fulfilled for the purposes of end-of-example verification (which is where this is used).

# File lib/rspec/mocks/any_instance/expectation_chain.rb, line 49
def expectation_fulfilled?
  true
end

Private Instance Methods

invocation_order() click to toggle source
# File lib/rspec/mocks/any_instance/expectation_chain.rb, line 55
def invocation_order
  @invocation_order ||= {
    :should_not_receive => [nil],
    :with => [:should_receive],
    :and_return => [:with, :should_receive],
    :and_raise => [:with, :should_receive]
  }
end