diff --git a/lib/shell/command-processor.rb b/lib/shell/command-processor.rb index 00357e06fdf0d7..82af76dd5ed711 100644 --- a/lib/shell/command-processor.rb +++ b/lib/shell/command-processor.rb @@ -180,6 +180,9 @@ def test(command, file1, file2=nil) top_level_test(command, file1) end else + unless FileTest.methods(false).include?(command.to_sym) + raise "unsupported command: #{ command }" + end if file2 FileTest.send(command, file1, file2) else diff --git a/test/shell/test_command_processor.rb b/test/shell/test_command_processor.rb index d0bcf8e349f5fc..7e1aa5bce7ed5f 100644 --- a/test/shell/test_command_processor.rb +++ b/test/shell/test_command_processor.rb @@ -68,6 +68,24 @@ def test_system_directory Dir.rmdir(path) end + def test_test + name = "foo#{exeext}" + path = File.join(@tmpdir, name) + open(path, "w", 0644) {} + + assert_equal(true, @shell[?e, path]) + assert_equal(true, @shell[:e, path]) + assert_equal(true, @shell["e", path]) + assert_equal(true, @shell[:exist?, path]) + assert_equal(true, @shell["exist?", path]) + assert_raise_with_message(RuntimeError, /unsupported command/) do + assert_equal(true, @shell[:instance_eval, path]) + end + ensure + Process.waitall + File.unlink(path) + end + def test_option_type name = 'foo.cmd' path = File.join(@tmpdir, name) diff --git a/version.h b/version.h index 2f3900ae1b9a8b..2731a5cf132176 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.6.5" #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 113 +#define RUBY_PATCHLEVEL 114 #define RUBY_RELEASE_YEAR 2019 #define RUBY_RELEASE_MONTH 10