class RSpec::Mocks::AnyInstance::StubChain

@private

Public Class Methods

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

@private

# File lib/rspec/mocks/any_instance/stub_chain.rb, line 8
def initialize(*args, &block)
  record(:stub, *args, &block)
end

Public Instance Methods

expectation_fulfilled?() click to toggle source

@private

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

Private Instance Methods

invocation_order() click to toggle source
# File lib/rspec/mocks/any_instance/stub_chain.rb, line 19
def invocation_order
  @invocation_order ||= {
    :stub => [nil],
    :with => [:stub],
    :and_return => [:with, :stub],
    :and_raise => [:with, :stub],
    :and_yield => [:with, :stub]
  }
end
verify_invocation_order(rspec_method_name, *args, &block) click to toggle source
# File lib/rspec/mocks/any_instance/stub_chain.rb, line 29
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