From 024a80710680be334f5c14f863f99bbccc951f9d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 29 Mar 2024 14:44:36 +0900 Subject: [PATCH] `system` with keyword argument works in recent JRuby --- test/helper.rb | 6 +++++- test/test_rake_file_utils.rb | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/test/helper.rb b/test/helper.rb index 7ef6e6958..619bf42c7 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -27,7 +27,7 @@ class TaskManager include Rake::TaskManager end - RUBY = File.realpath(ENV["RUBY"] || Gem.ruby) + RUBY = (ENV["RUBY"] || Gem.ruby) def setup ARGV.clear @@ -124,5 +124,9 @@ def jruby9? jruby? && (JRUBY_VERSION >= "9.0.0.0") end + def jruby90? + jruby? && JRUBY_VERSION.start_with?("9.0.") + end + include RakefileDefinitions end diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index df831944c..8dd49fa7f 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -182,7 +182,7 @@ def test_sh_with_multiple_arguments end def test_sh_with_spawn_options - omit "JRuby does not support spawn options" if jruby? + omit "JRuby does not support spawn options" if jruby90? echocommand @@ -198,7 +198,7 @@ def test_sh_with_spawn_options end def test_sh_with_hash_option - omit "JRuby does not support spawn options" if jruby? + omit "JRuby does not support spawn options" if jruby90? check_expansion verbose(false) { @@ -241,7 +241,7 @@ def test_sh_noop end def test_sh_chdir - omit "JRuby does not support spawn options" if jruby? + omit "JRuby does not support spawn options" if jruby90? Dir.mkdir "chdir_test" out, err = capture_output do @@ -257,7 +257,7 @@ def test_sh_chdir def test_sh_bad_option # Skip on JRuby because option checking is performed by spawn via system # now. - omit "JRuby does not support spawn options" if jruby? + omit "JRuby does not support spawn options" if jruby90? shellcommand @@ -402,7 +402,7 @@ def assert_echoes_fully end def test_ruby_with_multiple_arguments - omit if jruby9? # https://github.com/jruby/jruby/issues/3653 + omit if jruby90? # https://github.com/jruby/jruby/issues/3653 check_no_expansion