Skip to content

Commit e7b232a

Browse files
committed
test that yield is given number of seconds
1 parent 0f12a0e commit e7b232a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/test_timeout.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
require 'timeout'
44

55
class TestTimeout < Test::Unit::TestCase
6+
def test_yield_param
7+
assert_equal "5 seconds", Timeout.timeout(5){|s| "#{s} seconds" }
8+
end
9+
610
def test_queue
711
q = Thread::Queue.new
812
assert_raise(Timeout::Error, "[ruby-dev:32935]") {

0 commit comments

Comments
 (0)