diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_time.rb | 7 |
2 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Mon Jul 14 17:37:01 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com> + + * test/ruby/test_time.rb (TestTime#test_time_interval): add timeout + to avoid stopping tests. + Mon Jul 14 15:18:30 2008 NARUSE, Yui <naruse@ruby-lang.org> * transcode.c (get_replacement_character): temporary function, diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index c0620323fc..fe62f6a5b1 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -1,5 +1,6 @@ require 'test/unit' require 'rational' +require 'timeout' class TestTime < Test::Unit::TestCase def test_time_add() @@ -217,7 +218,11 @@ class TestTime < Test::Unit::TestCase def test_time_interval m = Mutex.new.lock - assert_nothing_raised { m.sleep(0) } + assert_nothing_raised { + Timeout.timeout(10) { + m.sleep(0) + } + } assert_raise(ArgumentError) { m.sleep(-1) } end |