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.
This commit is contained in:
Alan Wu 2022-11-18 14:59:04 -05:00
parent 2185f0ca77
commit 7f269a3c2d
Notes: git 2022-11-18 23:50:52 +00:00

View File

@ -440,7 +440,9 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
def run_pty(src, n = 1) def run_pty(src, n = 1)
pend("PTY.spawn cannot control terminal on JRuby") if RUBY_ENGINE == 'jruby' 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 rescue RuntimeError
omit $! omit $!
else else