Re: [rspec-users] Using and_yield to pass multiple or no iterations

2008-06-05 Thread John D. Hume
On Thu, Jun 5, 2008 at 5:46 AM, Doug Livesey <[EMAIL PROTECTED]> wrote: > I have two questions with it. The first is, would it be possible to set > it up to test the case when each_row operates on an empty Array? If there were no rows, each_row wouldn't yield at all, so you should just be able to

[rspec-users] Using and_yield to pass multiple or no iterations

2008-06-05 Thread Doug Livesey
Hi, imagine there's a class called Egg which has the following method (which calls another method): def do_thing has_iterated = false self.each_row do |row| has_iterated = true unless has_iterated end has_iterated end Stupid code, I know. I have two questions with it. The first is