class RSpec::Mocks::AnyInstance::StubChain

def expectation_filfilled?

def expectation_filfilled?
  true
end

def initialize(*args, &block)

def initialize(*args, &block)
  record(:stub, *args, &block)
end

def invocation_order

def invocation_order
  @invocation_order ||= {
    :stub => [nil],
    :with => [:stub],
    :and_return => [:with, :stub],
    :and_raise => [:with, :stub],
    :and_yield => [:with, :stub]
  }
end

def verify_invocation_order(rspec_method_name, *args, &block)

def verify_invocation_order(rspec_method_name, *args, &block)
  unless invocation_order[rspec_method_name].include?(last_message)
    raise(NoMethodError, "Undefined method #{rspec_method_name}")
  end
end