From: sto.mar@... Date: 2012-10-13T01:35:44+09:00 Subject: How to create a MiniTest::Mock object that expects to_s I suspect it is not possible, but maybe I'm lucky: how can I create a mock object with MiniTest that expects a call to the to_s method? 1.9.3-p194 :001 > require 'minitest/mock' ... 1.9.3-p194 :002 > obj = MiniTest::Mock.new ... 1.9.3-p194 :003 > obj.expect(:size, 5) ... 1.9.3-p194 :004 > obj.expect(:to_s, 'an object') ... 1.9.3-p194 :005 > obj.size => 5 1.9.3-p194 :006 > obj.to_s => "#" --