# File lib/rspec/mocks/message_expectation.rb, line 160 def and_yield(*args, &block) yield @eval_context = Object.new.extend(RSpec::Mocks::InstanceExec) if block @args_to_yield << args self.initial_implementation_action = AndYieldImplementation.new(@args_to_yield, @eval_context, @error_generator) self end