I have a method like this
class SomeClass
def self.test_method
while(true)
make_heavy_lifting
sleep(60*60)
end
end
end
How do i write test for this method.
one solution i thought of is stubbing sleep method and it worked but i am not able to stub the while keyword. please suggest best practices for unit testing a method which has infinite loop.