diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-06 12:11:45 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-06 12:11:45 +0000 |
commit | 78d7def61988764344d2630ae77113e1edb2af5d (patch) | |
tree | 8f4ed2e99a22ba50c7eca4c7c72574f2539740f9 /test | |
parent | aaf6bde9780173a989acc3af7d25debc350f53e8 (diff) | |
download | ruby-78d7def61988764344d2630ae77113e1edb2af5d.tar.gz |
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_process.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index d8f127eab7..4ff4023b51 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -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') |