Listen I've an interesting question here, the other day I ran into an "infinite-loop" problem using Rspec, Rspec couldn't even go through the spec related to other methods inside the loop and even the comp was almost crashing. Very funny. 

I'd like to test my future loops (While-loop in this case) against **infinite loop-code.**
How I can test this while-loop and catch up this problem like this one and make the proper correction?

Thanks!

This is my code from other day:

```
 i = 0
      while i <= Video.all.count do
        if ( @sampler = Video.find_next_sampler(@samplers[-1].end_time, @samplers[-1].end_point) )
          @samplers << @sampler
        else
          flash[:error] = 'There is not any more match for this video-sampler'
        end
        i + 1  #Now Here is the bug!! IT should be: i += 1

      end

```