class RSpec::Mocks::MessageExpectation

def twice(&block)

car.should_receive(:go).twice

@example

Expect a message to be received exactly two times.
def twice(&block)
  self.inner_implementation_action = block
  set_expected_received_count :exactly, 2
  self
end