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:
akr 2009-02-08 00:10:13 +00:00
Родитель b83188dc1e
Коммит ad235344c4
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

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