Skip to content

Commit

Permalink
don't exec in the test process.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Jun 4, 2012
1 parent 993b4f3 commit 9ab2ce2
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions test/ruby/test_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,22 @@ def test_execopts_env
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
Expand Down

0 comments on commit 9ab2ce2

Please sign in to comment.