From: Emil Sandin Date: 2008-11-07T18:28:29+09:00 Subject: Re: Redefine while Robert Klemme wrote: > On 06.11.2008 16:43, Emil Sandin wrote: > > I find your approach suspicious: you write a class with a method whose > regular behavior involves executing a loop. Then, during tests you want > the loop to not loop, i.e. you change the behavior of your method. > Strictly speaking the test result is then meaningless, because you do > not test the behavior of the method that you want to use regularly. > > If there is a complex operation in the loop that you want to test > separately you should probably refactor the code. Then you can have > your one off test. > > Cheers > > robert That is probably a good idea. -- Posted via http://www.ruby-forum.com/.