summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-08 15:38:13 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-08 15:38:13 +0000
commit45913acc68b8830e622031f0f5730fcb020bc765 (patch)
tree00293f7a22b39600a11915b0799dec4b2057778c /test
parent6ebb19c840296cb17c007d79c839e2d222da43a3 (diff)
Add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/test_open3.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/test_open3.rb b/test/test_open3.rb
index bdd9b4d..ca710bc 100644
--- a/test/test_open3.rb
+++ b/test/test_open3.rb
@@ -80,9 +80,17 @@ class TestOpen3 < Test::Unit::TestCase
end
end
- def test_numeric_file_descriptors
+ def test_numeric_file_descriptor2
+ with_pipe {|r, w|
+ Open3.popen2(RUBY, '-e', 'STDERR.puts "foo"', 2 => w) {|i,o,t|
+ assert_equal("foo\n", r.gets)
+ }
+ }
+ end
+
+ def test_numeric_file_descriptor3
skip "passing FDs bigger than 2 is not supported on Windows" if /mswin|mingw/ =~ RUBY_PLATFORM
- with_pipe { |r, w|
+ with_pipe {|r, w|
Open3.popen3(RUBY, '-e', 'IO.open(3).puts "foo"', 3 => w) {|i,o,e,t|
assert_equal("foo\n", r.gets, "[GH-808] [ruby-core:67347] [Bug #10699]")
}