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

* test/ruby/test_time.rb (TestTime#test_time_interval): add timeout

to avoid stopping tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2008-07-14 08:40:17 +00:00
parent ef62472e44
commit ae87557916
2 changed files with 11 additions and 1 deletions

View file

@ -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,

View file

@ -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