class RSpec::Mocks::MethodDouble

def add_expectation(error_generator, expectation_ordering, expected_from, opts, &block)

def add_expectation(error_generator, expectation_ordering, expected_from, opts, &block)
  configure_method
  expectation = if existing_stub = stubs.first
    existing_stub.build_child(expected_from, block, 1, opts)
  else
    MessageExpectation.new(error_generator, expectation_ordering, expected_from, @method_name, block, 1, opts)
  end
  expectations << expectation
  expectation
end