diff options
author | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2019-08-11 10:15:05 +0900 |
---|---|---|
committer | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2019-08-11 10:15:05 +0900 |
commit | f731cc0984560d8dabd211e7b827617fe078cca1 (patch) | |
tree | a948689381df907a6500755dcba9d4fb8e534ec1 /tool/lib/test | |
parent | 2990c2cc3e5a105013b829dad00fa43a26da8682 (diff) | |
download | ruby-f731cc0984560d8dabd211e7b827617fe078cca1.tar.gz |
Use `end_with?` instead of Regexp with missing escape
Diffstat (limited to 'tool/lib/test')
-rw-r--r-- | tool/lib/test/unit.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |