class MiniTest::Mock
def verify
def verify @expected_calls.each do |name, calls| calls.each do |expected| msg1 = "expected #{__call name, expected}" msg2 = "#{msg1}, got [#{__call name, @actual_calls[name]}]" raise MockExpectationError, msg2 if @actual_calls.has_key?(name) and not @actual_calls[name].include?(expected) raise MockExpectationError, msg1 unless @actual_calls.has_key?(name) and @actual_calls[name].include?(expected) end end true end