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
|
end
|
||||||
|
|
||||||
def test_execopts_preserve_env_on_exec_failure
|
def test_execopts_preserve_env_on_exec_failure
|
||||||
ENV["mgg"] = nil
|
with_tmpchdir {|d|
|
||||||
assert_raise(Errno::ENOENT) { Process.exec({"mgg" => "mggoo"}, "/nonexistent") }
|
write_file 's', <<-"End"
|
||||||
assert_equal(nil, ENV["mgg"], "[ruby-core:44093] [ruby-trunk - Bug #6249]")
|
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
|
end
|
||||||
|
|
||||||
def test_execopts_env_single_word
|
def test_execopts_env_single_word
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue