diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-08 00:10:13 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-08 00:10:13 +0000 |
commit | ad235344c4e7371a58138565d0c126f136125b8a (patch) | |
tree | 900c271d3a6e281362870eb4d7c15c39b22b9bbe /test/ruby | |
parent | b83188dc1efb5d9ce1b25333965d6a35309579f7 (diff) | |
download | ruby-ad235344c4e7371a58138565d0c126f136125b8a.tar.gz |
specify exception class for rescue clause.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_process.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 9b5559dfa1..793771017e 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -111,13 +111,21 @@ class TestProcess < Test::Unit::TestCase s = run_in_child(<<-'End') cur, max = Process.getrlimit(:NOFILE) Process.setrlimit(:NOFILE, max-10) - Process.setrlimit(:NOFILE, :INFINITY) rescue exit 1 + begin + Process.setrlimit(:NOFILE, :INFINITY) + rescue Errno::EPERM + exit 1 + end End assert_not_equal(0, s.exitstatus) s = run_in_child(<<-'End') cur, max = Process.getrlimit(:NOFILE) Process.setrlimit(:NOFILE, max-10) - Process.setrlimit(:NOFILE, "INFINITY") rescue exit 1 + begin + Process.setrlimit(:NOFILE, "INFINITY") + rescue Errno::EPERM + exit 1 + end End assert_not_equal(0, s.exitstatus) end |