class RSpec::Mocks::Proxy

def replay_received_message_on(expectation, &block)

Other tags:
    Private: -
def replay_received_message_on(expectation, &block)
  expected_method_name = expectation.message
  meth_double = method_double_for(expected_method_name)
  if meth_double.expectations.any?
    @error_generator.raise_expectation_on_mocked_method(expected_method_name)
  end
  unless null_object? || meth_double.stubs.any?
    @error_generator.raise_expectation_on_unstubbed_method(expected_method_name)
  end
  @messages_received_mutex.synchronize do
    @messages_received.each do |(actual_method_name, args, received_block)|
      next unless expectation.matches?(actual_method_name, *args)
      expectation.safe_invoke(nil)
      block.call(*args, &received_block) if block
    end
  end
end