From e23c02959040dcd5c399bbac84fed4ef2eae1ec0 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Fri, 3 Oct 2025 16:37:19 +0900 Subject: [PATCH] Fix EnvUtil.invoke_ruby on Ruby < 3.3 Only pass --parser= option to Ruby versions that accept it. test-unit-ruby-core currently supports Ruby >= 2.3. --- lib/envutil.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/envutil.rb b/lib/envutil.rb index ab5e8d8..71f7b96 100644 --- a/lib/envutil.rb +++ b/lib/envutil.rb @@ -225,7 +225,7 @@ def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr = args = [args] if args.kind_of?(String) # use the same parser as current ruby - if args.none? { |arg| arg.start_with?("--parser=") } + if RUBY_VERSION >= "3.3" && args.none? { |arg| arg.start_with?("--parser=") } args = ["--parser=#{current_parser}"] + args end pid = spawn(child_env, *precommand, rubybin, *args, opt)