diff options
author | CosmicOppai <[email protected]> | 2024-10-15 06:21:18 +0530 |
---|---|---|
committer | git <[email protected]> | 2024-12-03 06:49:55 +0000 |
commit | e7dd185e2147ff0ce5ad6a3de563749a4ad8ccb2 (patch) | |
tree | a0eb3f322db4884197f9f9a9eb72f95463e32de3 /test | |
parent | 0839eae2d362b70d1b36b939b7ad6aa809a618a9 (diff) |
[ruby/timeout] refactor the change to raise for nil and type-errror and added tests
https://github.com/ruby/timeout/commit/ffc8d7c003
Diffstat (limited to 'test')
-rw-r--r-- | test/test_timeout.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_timeout.rb b/test/test_timeout.rb index d6c1a1f9d0..bc3036386a 100644 --- a/test/test_timeout.rb +++ b/test/test_timeout.rb @@ -26,7 +26,7 @@ class TestTimeout < Test::Unit::TestCase end def test_allows_nil_seconds - assert_nothing_raised do + assert_raise(ArgumentError) do assert_equal :ok, Timeout.timeout(nil){:ok} end end @@ -120,7 +120,7 @@ class TestTimeout < Test::Unit::TestCase def test_cannot_convert_into_time_interval bug3168 = '[ruby-dev:41010]' def (n = Object.new).zero?; false; end - assert_raise(TypeError, bug3168) {Timeout.timeout(n) { sleep 0.1 }} + assert_raise(ArgumentError, bug3168) {Timeout.timeout(n) { sleep 0.1 }} end def test_skip_rescue_standarderror |