From 77f90867687725578e25c28ec15580912c4ba93b Mon Sep 17 00:00:00 2001 From: John Bachir Date: Sun, 9 Jul 2023 02:03:55 -0400 Subject: [PATCH] [ruby/timeout] tests for blank seconds https://github.com/ruby/timeout/commit/54bc7639d2 --- test/test_timeout.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/test_timeout.rb b/test/test_timeout.rb index 27b34de454..b1a93a7a7e 100644 --- a/test/test_timeout.rb +++ b/test/test_timeout.rb @@ -19,6 +19,18 @@ class TestTimeout < Test::Unit::TestCase end end + def test_allows_zero_seconds + assert_nothing_raised do + assert_equal :ok, Timeout.timeout(0){:ok} + end + end + + def test_allows_nil_seconds + assert_nothing_raised do + assert_equal :ok, Timeout.timeout(nil){:ok} + end + end + def test_included c = Class.new do include Timeout