From: James Edward Gray II Date: 2005-10-18T22:13:18+09:00 Subject: Re: Unit testing an each function On Oct 18, 2005, at 4:43 AM, Peter Hickman wrote: > I am testing a new class I have written that has an each method, > how do I write a test for this? > > Build an array from the each and compare it to another array with > the correct data in it or is there a cleaner way of doing this? I've done it that way before. If you mix in Enumerable you can also use: assert_equals(correct_values, test_class.to_a) Hope that helps. James Edward Gray II