summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-27 09:25:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-27 09:25:54 +0000
commitc05e6a8cda4701d995d8e4b2390ee2b88b51e6d6 (patch)
tree0b06092c19b9aed6b0591346edb050e3376ce8bd /test/ruby
parenta8aa1e2127e6329e2f632a2296d3f36f1c6de2ac (diff)
process.c: try conversion at redirection
* io.c (rb_io_check_io): make public. * process.c (check_exec_redirect): try conversion to IO on redirect parameters. [ruby-core:44181] [Bug #6269] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_process.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 26073db089..a34da82d5b 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1,5 +1,5 @@
require 'test/unit'
-require 'tmpdir'
+require 'tempfile'
require 'pathname'
require 'timeout'
require_relative 'envutil'
@@ -806,6 +806,18 @@ class TestProcess < Test::Unit::TestCase
end
end
+ def test_execopts_redirect_tempfile
+ bug6269 = '[ruby-core:44181]'
+ Tempfile.open("execopts") do |tmp|
+ pid = assert_nothing_raised(ArgumentError, bug6269) do
+ break spawn(RUBY, "-e", "print $$", out: tmp)
+ end
+ Process.wait(pid)
+ tmp.rewind
+ assert_equal(pid.to_s, tmp.read)
+ end
+ end
+
def test_execopts_duplex_io
IO.popen("#{RUBY} -e ''", "r+") {|duplex|
assert_raise(ArgumentError) { system("#{RUBY} -e ''", duplex=>STDOUT) }