From 729c13828514b9632bad9ab73b62153eeee48a7c Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Wed, 26 Aug 2026 16:18:39 +0900 Subject: [PATCH] Use RUBY for CLI test subprocesses Co-Authored-By: Codex --- test/rbs/cli_test.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/rbs/cli_test.rb b/test/rbs/cli_test.rb index 3d37fe9c0..9e700dc91 100644 --- a/test/rbs/cli_test.rb +++ b/test/rbs/cli_test.rb @@ -33,7 +33,8 @@ def refute_cli_success(exit_status = nil, &) # with a version mismatch error when `RUBYLIB` points at the standard library of the running Ruby. # That is what happens in ruby/ruby CI, where the tests run with a freshly built `ruby`. # - BUNDLE_COMMAND = [RbConfig.ruby, "-S", "bundle"] + RUBY_EXECUTABLE = ENV["RUBY"] || RbConfig.ruby + BUNDLE_COMMAND = [RUBY_EXECUTABLE, "-S", "bundle"] # Run `rbs collection` with fresh bundler environment # @@ -54,7 +55,7 @@ def run_rbs_collection(*commands, bundler:) rbs_path << (":" + rblib) end - Open3.capture3({ "RUBYLIB" => rbs_path }, *bundle_exec, RbConfig.ruby, "#{__dir__}/../../exe/rbs", "--log-level=debug", "collection", *commands, chdir: Dir.pwd) + Open3.capture3({ "RUBYLIB" => rbs_path }, *bundle_exec, RUBY_EXECUTABLE, "#{__dir__}/../../exe/rbs", "--log-level=debug", "collection", *commands, chdir: Dir.pwd) end if block_given?