From: Phillip Gawlowski Date: 2007-04-11T17:22:30+09:00 Subject: Re: The unit test that won't. Brian Candler wrote: > I don't understand what you've written above - you might want to paste an > example. For both Array#each and Array#collect!, the values passed to the > block are the elements of the array. The difference is in what happens to > the value returned by the block; #each ignores it, #collect! replaces the > original array element with it. Ah, that cleared up *my* confusion. I wanted #each in the first place, but made mistakes in writing my code. Well, the learning never stops. > As a separate point though: if to_textile changes the state of your ClothRed > object, you might want to consider calling it something else. I have changed that behavior. #to_textile is non-destructive (at least it should be, I have to add a test for that). > Personally I would be surprised to find a Ruby library with a "to_textile" > method, where the main purpose of the function was to change the state of > the receiver, and _not_ to return a textile object. Yes, I'd expect that from #to-textile!, too, which was my intention in the first place. -- Phillip "CynicalRyan" Gawlowski http://cynicalryan.110mb.com/ Rule of Open-Source Programming #48: The number of items on a project's to-do list always grows or remains constant.