summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-10 00:49:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-10 00:49:17 +0000
commitfb7e6e10393324e2237e242e2d3ceebe3e47c675 (patch)
treec2b18b9a11047f02c6cdcb3d1ca9e1e23eb5466c
parent38320caaf60833afff317960ed572aa52d8a2b1c (diff)
test_process.rb: fix pgroup test
* test/ruby/test_process.rb (TestProcess#test_execopts_pgroup): use dynamically assigned pid for the process group, instead of a magic number 2. [ruby-core:78051] [Bug #12909] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_process.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 3921395466..8ad53ac78e 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -181,7 +181,11 @@ class TestProcess < Test::Unit::TestCase
io.close
assert_raise(ArgumentError) { system(*TRUECOMMAND, :pgroup=>-1) }
- assert_raise(Errno::EPERM) { Process.wait spawn(*TRUECOMMAND, :pgroup=>2) }
+ IO.popen([RUBY, '-egets'], 'w') do |f|
+ assert_raise(Errno::EPERM) {
+ Process.wait spawn(*TRUECOMMAND, :pgroup=>f.pid)
+ }
+ end
io1 = IO.popen([RUBY, "-e", "print Process.getpgrp", :pgroup=>true])
io2 = IO.popen([RUBY, "-e", "print Process.getpgrp", :pgroup=>io1.pid])