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