From: Ryan Davis Date: 2008-09-24T17:23:44+09:00 Subject: [ruby-core:18846] Re: miniunit added On Sep 24, 2008, at 00:27 , Yukihiro Matsumoto wrote: > |% limit stacksize 500k > |% ./ruby -ve ' > | class CyclicRange < Range > | def <=>(other); true; end > | end > | o = CyclicRange.allocate > | o.instance_eval { initialize(o, o) } > | p o > |' > > I know it's possible with artificial programs like above, but what I > was interested in was how realistic application like miniunit made it. afaik, all miniunit did was inspect an object like the above. The test in question was: class CyclicRange < Range def <=>(other); true; end end def test_range_cyclic return unless CyclicRange.respond_to?(:allocate) # test for 1.8 o1 = CyclicRange.allocate o1.instance_eval { initialize(o1, o1) } o2 = marshaltest(o1) assert_same(o2, o2.begin) assert_same(o2, o2.end) end and miniunit inspected o2 w/in the assert_same method.