class RSpec::Mocks::AnyInstance::StubChain

@private

Constants

EmptyInvocationOrder
InvocationOrder

Public Instance Methods

expectation_fulfilled?() click to toggle source

@private

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

Private Instance Methods

create_message_expectation_on(instance) click to toggle source
# File lib/rspec/mocks/any_instance/stub_chain.rb, line 13
def create_message_expectation_on(instance)
  proxy = ::RSpec::Mocks.space.proxy_for(instance)
  method_name, opts = @expectation_args
  opts = (opts || {}).merge(:expected_form => IGNORED_BACKTRACE_LINE)

  stub = proxy.add_stub(method_name, opts, &@expectation_block)
  @recorder.stubs[stub.message] << stub

  if RSpec::Mocks.configuration.yield_receiver_to_any_instance_implementation_blocks?
    stub.and_yield_receiver_to_implementation
  end

  stub
end
invocation_order() click to toggle source
# File lib/rspec/mocks/any_instance/stub_chain.rb, line 40
def invocation_order
  InvocationOrder
end
verify_invocation_order(rspec_method_name, *_args, &_block) click to toggle source
# File lib/rspec/mocks/any_instance/stub_chain.rb, line 44
def verify_invocation_order(rspec_method_name, *_args, &_block)
  return if invocation_order.fetch(rspec_method_name, [nil]).include?(last_message)
  raise NoMethodError, "Undefined method #{rspec_method_name}"
end