MiniTest::Mock 二,进一步示例分析
据说,如果对mock stub 和fakes概念不熟悉的话可以看看这个 我自己看了一下,没懂。还是看例子容易些
例如,有这么个东西需要测试
def verify @expected_calls.each_key do |name| expected = @expected_calls[name] msg = "expected #{name}, #{expected.inspect}" raise MockExpectationError, msg unless @actual_calls.has_key? name and @actual_calls[name].include?(expected) end trueend#验证