From f731cc0984560d8dabd211e7b827617fe078cca1 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Sun, 11 Aug 2019 10:15:05 +0900 Subject: Use `end_with?` instead of Regexp with missing escape --- tool/lib/test/unit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tool/lib') diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb index 8832022fbe..2d5a32ed67 100644 --- a/tool/lib/test/unit.rb +++ b/tool/lib/test/unit.rb @@ -872,7 +872,7 @@ module Test return File.join(File.dirname(f), basename+'.rb') elsif /\Atest_/ !~ basename return File.join(File.dirname(f), 'test_'+basename) - end if /#{basename}\z/ =~ f # otherwise basename is dirname/ + end if f.end_with?(basename) # otherwise basename is dirname/ raise ArgumentError, "file not found: #{orig_f}" end -- cgit v1.2.3