mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
993b4f3911
commit
9ab2ce20b3
1 changed files with 16 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue