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

ruby-changes:23861

From: akr <ko1@a...>
Date: Mon, 4 Jun 2012 21:52:44 +0900 (JST)
Subject: [ruby-changes:23861] akr:r35912 (trunk): don't exec in the test process.

akr	2012-06-04 21:52:35 +0900 (Mon, 04 Jun 2012)

  New Revision: 35912

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35912

  Log:
    don't exec in the test process.

  Modified files:
    trunk/test/ruby/test_process.rb

Index: test/ruby/test_process.rb
===================================================================
--- test/ruby/test_process.rb	(revision 35911)
+++ test/ruby/test_process.rb	(revision 35912)
@@ -304,9 +304,22 @@
   end
 
   def test_execopts_preserve_env_on_exec_failure
-    ENV["mgg"] = nil
-    assert_raise(Errno::ENOENT) { Process.exec({"mgg" => "mggoo"}, "/nonexistent") }
-    assert_equal(nil, ENV["mgg"], "[ruby-core:44093] [ruby-trunk - Bug #6249]")
+    with_tmpchdir {|d|
+      write_file 's', <<-"End"
+        ENV["mgg"] = nil
+        prog = "/nonexistent"
+        begin
+          Process.exec({"mgg" => "mggoo"}, [prog, prog])
+        rescue Errno::ENOENT
+        end
+        open('out', 'w') {|f|
+          f.print ENV["mgg"].inspect
+        }
+      End
+      system(RUBY, 's')
+      assert_equal(nil.inspect, File.read('out'),
+        "[ruby-core:44093] [ruby-trunk - Bug #6249]")
+    }
   end
 
   def test_execopts_env_single_word

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

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