# File lib/rspec/mocks/message_expectation.rb, line 382 def twice(&block) @implementation = block if block set_expected_received_count :exactly, 2 self end