diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-13 10:07:01 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-13 10:07:01 +0000 |
| commit | beb1c085d582b4ac187309560eb871dda5bc3c28 (patch) | |
| tree | 70a84bbd1128ba33d3101bf9323a6977e6b2c754 /test/ruby | |
| parent | 42f1ff127249fe4d86c0f7b7ef2b920cbb71601b (diff) | |
use Timeout.timeout
* time: Object#timeout has been deprecated a long time ago, use
Timeout.timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_io_m17n.rb | 2 | ||||
| -rw-r--r-- | test/ruby/test_process.rb | 2 | ||||
| -rw-r--r-- | test/ruby/test_readpartial.rb | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index c464bceae0..4382824844 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -468,7 +468,7 @@ EOT w.close end, proc do |r| - timeout(1) { + Timeout.timeout(1) { assert_equal("before \xa2\xa2".encode("utf-8", "euc-jp"), r.gets(rs)) } diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 02ba47fb35..e4d36f075b 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1591,7 +1591,7 @@ class TestProcess < Test::Unit::TestCase with_tmpchdir do assert_nothing_raised('[ruby-dev:12261]') do - timeout(3) do + Timeout.timeout(3) do pid = spawn('yes | ls') Process.waitpid pid end diff --git a/test/ruby/test_readpartial.rb b/test/ruby/test_readpartial.rb index 7f2ec65ac7..bc84da7d12 100644 --- a/test/ruby/test_readpartial.rb +++ b/test/ruby/test_readpartial.rb @@ -51,7 +51,7 @@ class TestReadPartial < Test::Unit::TestCase assert_equal('ab', r.readpartial(2)) assert_equal('c', r.readpartial(2)) assert_raise(Timeout::Error) { - timeout(0.1) { r.readpartial(2) } + Timeout.timeout(0.1) { r.readpartial(2) } } } end @@ -65,7 +65,7 @@ class TestReadPartial < Test::Unit::TestCase assert_equal("f\n", r.readpartial(4096)) assert_equal("ghi\n", r.readpartial(4096)) assert_raise(Timeout::Error) { - timeout(0.1) { r.readpartial(2) } + Timeout.timeout(0.1) { r.readpartial(2) } } } end |
