aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-04 12:52:35 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-04 12:52:35 +0000
commit9ab2ce20b3197b9f8c6bb8caca508ed6c04f1f5c (patch)
tree2b72fc576ebc7be560664463a83a61fe0bc257fe /test/ruby
parent993b4f391153dbc731af1c73b31bcec1690eed53 (diff)
downloadruby-9ab2ce20b3197b9f8c6bb8caca508ed6c04f1f5c.tar.gz
don't exec in the test process.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_process.rb19
1 files changed, 16 insertions, 3 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index fb18e97b1f..32d5aee62d 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -304,9 +304,22 @@ class TestProcess < Test::Unit::TestCase
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