summaryrefslogtreecommitdiff
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-08 00:10:13 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-08 00:10:13 +0000
commitad235344c4e7371a58138565d0c126f136125b8a (patch)
tree900c271d3a6e281362870eb4d7c15c39b22b9bbe /test/ruby/test_process.rb
parentb83188dc1efb5d9ce1b25333965d6a35309579f7 (diff)
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/test_process.rb')
-rw-r--r--test/ruby/test_process.rb12
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