[前][次][番号順一覧][スレッド一覧]

ruby-changes:44611

From: nobu <ko1@a...>
Date: Thu, 10 Nov 2016 09:49:23 +0900 (JST)
Subject: [ruby-changes:44611] nobu:r56684 (trunk): test_process.rb: fix pgroup test

nobu	2016-11-10 09:49:17 +0900 (Thu, 10 Nov 2016)

  New Revision: 56684

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56684

  Log:
    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]

  Modified files:
    trunk/test/ruby/test_process.rb
Index: test/ruby/test_process.rb
===================================================================
--- test/ruby/test_process.rb	(revision 56683)
+++ test/ruby/test_process.rb	(revision 56684)
@@ -181,7 +181,11 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L181
     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])

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]