From 7f269a3c2d19e28d493a492748cd998d4cd43c89 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Fri, 18 Nov 2022 14:59:04 -0500 Subject: Fix io/console test for --with-static-linked-ext The tests looks for the .so file, which doesn't exist when the extension is statically linked. In that situation it passes -I to ruby with nothing after it which ate the -rio/console argument. --- test/io/console/test_io_console.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/io/console/test_io_console.rb') diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 3c44181f2a..27d8e4a988 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -440,7 +440,9 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do def run_pty(src, n = 1) pend("PTY.spawn cannot control terminal on JRuby") if RUBY_ENGINE == 'jruby' - r, w, pid = PTY.spawn(EnvUtil.rubybin, "-I#{TestIO_Console::PATHS.join(File::PATH_SEPARATOR)}", "-rio/console", "-e", src) + args = ["-I#{TestIO_Console::PATHS.join(File::PATH_SEPARATOR)}", "-rio/console", "-e", src] + args.shift if args.first == "-I" # statically linked + r, w, pid = PTY.spawn(EnvUtil.rubybin, *args) rescue RuntimeError omit $! else -- cgit v1.2.3