summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_io.rb6
-rw-r--r--test/ruby/test_process.rb2
2 files changed, 5 insertions, 3 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index eac4e59a8f..5d554d7fb4 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1137,8 +1137,10 @@ class TestIO < Test::Unit::TestCase
def test_dup_many
ruby('-e', <<-'End') {|f|
- lim = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
- Process.setrlimit(Process::RLIMIT_NOFILE, [lim, 1024].min)
+ if defined?(Process::RLIMIT_NOFILE)
+ lim = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+ Process.setrlimit(Process::RLIMIT_NOFILE, [lim, 1024].min)
+ end
ok = 0
a = []
begin
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 2910ff8bd4..6512ef2dd7 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1597,7 +1597,7 @@ class TestProcess < Test::Unit::TestCase
exs = [Errno::ENOENT]
exs << Errno::E2BIG if defined?(Errno::E2BIG)
opts = {[STDOUT, STDERR]=>File::NULL}
- opts[:rlimit_nproc] = 128 if /mswin|mingw/ =~ RUBY_PLATFORM
+ opts[:rlimit_nproc] = 128 if defined?(Process::RLIMIT_NPROC)
EnvUtil.suppress_warning do
assert_raise(*exs, mesg) do
begin