summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--test/ruby/test_process.rb16
2 files changed, 16 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 7913321d07..318762bf8a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Mar 3 21:21:42 2011 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_process.rb (test_execopts_redirect): redirecting fd
+ >= 3 is not supported on Windows, so should not specify such options
+ when calling spawn or others.
+
Thu Mar 3 18:59:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
* string.c (rb_str_slice_bang): raise error when the string is frozen.
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index b45bfb9bb0..e0351a6832 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -387,13 +387,17 @@ class TestProcess < Test::Unit::TestCase
Process.wait Process.spawn(*ECHO["d"], f=>STDOUT, STDOUT=>f)
assert_equal("d", File.read("out").chomp)
}
- Process.wait Process.spawn(*ECHO["e"], STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644],
- 3=>STDOUT, 4=>STDOUT, 5=>STDOUT, 6=>STDOUT, 7=>STDOUT)
+ opts = {STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644]}
+ if /mswin|mingw/ !~ RUBY_PLATFORM
+ opts.merge(3=>STDOUT, 4=>STDOUT, 5=>STDOUT, 6=>STDOUT, 7=>STDOUT)
+ end
+ Process.wait Process.spawn(*ECHO["e"], opts)
assert_equal("e", File.read("out").chomp)
- Process.wait Process.spawn(*ECHO["ee"], STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644],
- 3=>0, 4=>:in, 5=>STDIN,
- 6=>1, 7=>:out, 8=>STDOUT,
- 9=>2, 10=>:err, 11=>STDERR)
+ opts = {STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644]}
+ if /mswin|mingw/ !~ RUBY_PLATFORM
+ opts.merge(3=>0, 4=>:in, 5=>STDIN, 6=>1, 7=>:out, 8=>STDOUT, 9=>2, 10=>:err, 11=>STDERR)
+ end
+ Process.wait Process.spawn(*ECHO["ee"], opts)
assert_equal("ee", File.read("out").chomp)
if /mswin|mingw/ !~ RUBY_PLATFORM
# passing non-stdio fds is not supported on Windows