From: Peter Hickman Date: 2005-10-18T22:29:59+09:00 Subject: Re: Unit testing an each function Kevin Ballard wrote: >That sounds fine to me. What's wrong with that method? > > At the moment the source for the tests looks like poetry, very terse and clean, where everything is a bold statement that does something. Then building up arrays of expected results and collecting the output to be tested looks very clumsy in the middle of the elegant tests. It's more of an aesthetic thing, if it looks 'ugly' (and code in ruby tends to look beautiful) then I start to wonder if perhaps I could be doing this differently. Pity you cant seem to do @data.each.each {|i| yield i} as it seems a perfect one-liner to me.