# File lib/rspec/mocks/method_double.rb, line 135 def add_expectation(error_generator, expectation_ordering, expected_from, opts, &implementation) configure_method expectation = if existing_stub = stubs.first existing_stub.build_child(expected_from, 1, opts, &implementation) else MessageExpectation.new(error_generator, expectation_ordering, expected_from, @method_name, 1, opts, &implementation) end expectations << expectation expectation end