1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/timeout] test for basic functionality

https://github.com/ruby/timeout/commit/1c6bb90aea
This commit is contained in:
John Bachir 2021-09-24 22:19:51 +01:00 committed by git
parent 00cfafc0f5
commit 582602d142

View file

@ -3,6 +3,13 @@ require 'test/unit'
require 'timeout' require 'timeout'
class TestTimeout < Test::Unit::TestCase class TestTimeout < Test::Unit::TestCase
def test_non_timing_out_code_is_successful
assert_nothing_raised do
assert_equal :ok, Timeout.timeout(1){ :ok }
end
end
def test_queue def test_queue
q = Thread::Queue.new q = Thread::Queue.new
assert_raise(Timeout::Error, "[ruby-dev:32935]") { assert_raise(Timeout::Error, "[ruby-dev:32935]") {