1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

add a test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2012-06-06 12:11:45 +00:00
parent aaf6bde978
commit 78d7def619

View file

@ -870,6 +870,25 @@ class TestProcess < Test::Unit::TestCase
}
end
def test_popen_wordsplit_beginning_and_trailing_spaces
with_tmpchdir {|d|
write_file("script", <<-'End')
print "fufumm pid=#{$$} ppid=#{Process.ppid}"
exit 7
End
str = " #{RUBY} script "
io = IO.popen(str)
pid = io.pid
result = io.read
io.close
status = $?
assert_equal(pid, status.pid)
assert(status.exited?)
assert_equal(7, status.exitstatus)
assert_equal("fufumm pid=#{status.pid} ppid=#{$$}", result)
}
end
def test_exec_wordsplit
with_tmpchdir {|d|
write_file("script", <<-'End')