summaryrefslogtreecommitdiff
path: root/test/test_timeout.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_timeout.rb')
-rw-r--r--test/test_timeout.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_timeout.rb b/test/test_timeout.rb
index 74b65f119d..58eb8421db 100644
--- a/test/test_timeout.rb
+++ b/test/test_timeout.rb
@@ -10,6 +10,18 @@ class TestTimeout < Test::Unit::TestCase
end
end
+ def test_included
+ c = Class.new do
+ include Timeout
+ def test
+ timeout(1) { :ok }
+ end
+ end
+ assert_nothing_raised do
+ assert_equal :ok, c.new.test
+ end
+ end
+
def test_yield_param
assert_equal [5, :ok], Timeout.timeout(5){|s| [s, :ok] }
end
@@ -43,6 +55,7 @@ class TestTimeout < Test::Unit::TestCase
begin
sleep 3
rescue Exception => e
+ flunk "should not see any exception but saw #{e.inspect}"
end
end
end