From 004c6a6ed16a66f027c12606f96153a03e624005 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 22 Aug 2024 15:20:07 +0900 Subject: [PATCH] Use ruby to suppress a warning message by cmd.exe It is expected that reading from command with offset fails by ESPIPE and the pipe will be closed immediately. While this causes the child process to terminate by SIGPIPE usually, cmd.exe yields the message bellow. ``` The process tried to write to a nonexistent pipe. ``` --- test/ruby/test_io.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index ce81286c4d..8b4dc1ed98 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2543,7 +2543,7 @@ class TestIO < Test::Unit::TestCase end assert_raise(Errno::ESPIPE) do assert_deprecated_warning(/IO process creation with a leading '\|'/) do # https://bugs.ruby-lang.org/issues/19630 - IO.read("|echo foo", 1, 1) + IO.read("|#{EnvUtil.rubybin} -e 'puts :foo'", 1, 1) end end end