mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 02:53:57 +02:00
specify exception class for rescue clause.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b83188dc1e
commit
ad235344c4
1 changed files with 10 additions and 2 deletions
|
@ -111,13 +111,21 @@ class TestProcess < Test::Unit::TestCase
|
||||||
s = run_in_child(<<-'End')
|
s = run_in_child(<<-'End')
|
||||||
cur, max = Process.getrlimit(:NOFILE)
|
cur, max = Process.getrlimit(:NOFILE)
|
||||||
Process.setrlimit(:NOFILE, max-10)
|
Process.setrlimit(:NOFILE, max-10)
|
||||||
Process.setrlimit(:NOFILE, :INFINITY) rescue exit 1
|
begin
|
||||||
|
Process.setrlimit(:NOFILE, :INFINITY)
|
||||||
|
rescue Errno::EPERM
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
End
|
End
|
||||||
assert_not_equal(0, s.exitstatus)
|
assert_not_equal(0, s.exitstatus)
|
||||||
s = run_in_child(<<-'End')
|
s = run_in_child(<<-'End')
|
||||||
cur, max = Process.getrlimit(:NOFILE)
|
cur, max = Process.getrlimit(:NOFILE)
|
||||||
Process.setrlimit(:NOFILE, max-10)
|
Process.setrlimit(:NOFILE, max-10)
|
||||||
Process.setrlimit(:NOFILE, "INFINITY") rescue exit 1
|
begin
|
||||||
|
Process.setrlimit(:NOFILE, "INFINITY")
|
||||||
|
rescue Errno::EPERM
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
End
|
End
|
||||||
assert_not_equal(0, s.exitstatus)
|
assert_not_equal(0, s.exitstatus)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue