summaryrefslogtreecommitdiff
path: root/test/io/console
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2022-11-18 14:59:04 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2022-11-18 18:50:34 -0500
commit7f269a3c2d19e28d493a492748cd998d4cd43c89 (patch)
treee2ea9b5165b77e41a26b30a7f376a54d15bea4d5 /test/io/console
parent2185f0ca772c1e8c318198b54e3a694b55945bbb (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6765
Diffstat (limited to 'test/io/console')
-rw-r--r--test/io/console/test_io_console.rb4
1 files changed, 3 insertions, 1 deletions
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