Skip to content

Commit

Permalink
test that yield is given number of seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
jjb committed Sep 24, 2021
1 parent 0f12a0e commit e7b232a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/test_timeout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
require 'timeout'

class TestTimeout < Test::Unit::TestCase
def test_yield_param
assert_equal "5 seconds", Timeout.timeout(5){|s| "#{s} seconds" }
end

def test_queue
q = Thread::Queue.new
assert_raise(Timeout::Error, "[ruby-dev:32935]") {
Expand Down

0 comments on commit e7b232a

Please sign in to comment.