don't exec in the test process.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2012-06-04 12:52:35 +00:00
Родитель 993b4f3911
Коммит 9ab2ce20b3
1 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -304,9 +304,22 @@ class TestProcess < Test::Unit::TestCase
end
def test_execopts_preserve_env_on_exec_failure
with_tmpchdir {|d|
write_file 's', <<-"End"
ENV["mgg"] = nil
assert_raise(Errno::ENOENT) { Process.exec({"mgg" => "mggoo"}, "/nonexistent") }
assert_equal(nil, ENV["mgg"], "[ruby-core:44093] [ruby-trunk - Bug #6249]")
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