timeout(0) -> never timeout (compatible to Timeout)

This commit is contained in:
Denis Knauf 2013-03-14 16:26:07 +01:00
parent 0a0f47650e
commit 9f993da845
2 changed files with 18 additions and 7 deletions

View file

@ -152,4 +152,11 @@ class TestRubyTimeoutInterrupt < Test::Unit::TestCase
end
end
end
should "not timeout, if timeout is 0" do
assert_nothing_raised TimeoutInterrupt::Error, "Unexpected Timed out." do
# should never timeout (we can not wait infinity seconds, so only 5)
TimeoutInterrupt.timeout( 0) { sleep 5 }
end
end
end