summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-04-04 12:03:13 +0900
committergit <svn-admin@ruby-lang.org>2023-04-04 12:20:43 +0000
commita881b33818b101ad097cd0158afda11b6c24f1fc (patch)
tree73111721667233a91e214e4df703d91ab19cfded /test
parenta78e0ca968115cbf57228cf2c026d2e21534dc7b (diff)
[rubygems/rubygems] util/rubocop -A --only Performance/RegexpMatch
https://github.com/rubygems/rubygems/commit/52ae4452c2
Diffstat (limited to 'test')
-rw-r--r--test/rubygems/helper.rb2
-rw-r--r--test/rubygems/test_gem_ext_builder.rb2
-rw-r--r--test/rubygems/utilities.rb4
3 files changed, 4 insertions, 4 deletions
diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb
index 017bbcc8f7..ef6ff858df 100644
--- a/test/rubygems/helper.rb
+++ b/test/rubygems/helper.rb
@@ -1337,7 +1337,7 @@ Also, a list:
def escape_path(*path)
path = File.join(*path)
- if %r{\A[-+:/=@,.\w]+\z} =~ path
+ if %r{\A[-+:/=@,.\w]+\z}.match?(path)
path
else
"\"#{path.gsub(/[`$"]/, '\\&')}\""
diff --git a/test/rubygems/test_gem_ext_builder.rb b/test/rubygems/test_gem_ext_builder.rb
index 3decab78b0..4734a77fee 100644
--- a/test/rubygems/test_gem_ext_builder.rb
+++ b/test/rubygems/test_gem_ext_builder.rb
@@ -52,7 +52,7 @@ install:
assert_match %r{DESTDIR\\=#{ENV['DESTDIR']}$}, results
assert_match %r{DESTDIR\\=#{ENV['DESTDIR']} install$}, results
- if /nmake/ !~ results
+ if !/nmake/.match?(results)
assert_match %r{^clean: destination$}, results
assert_match %r{^all: destination$}, results
assert_match %r{^install: destination$}, results
diff --git a/test/rubygems/utilities.rb b/test/rubygems/utilities.rb
index 0f9eef3ec5..2bd28d9a4b 100644
--- a/test/rubygems/utilities.rb
+++ b/test/rubygems/utilities.rb
@@ -120,7 +120,7 @@ class Gem::FakeFetcher
path = path.to_s
@paths << path
- raise ArgumentError, "need full URI" unless path =~ %r{^http://}
+ raise ArgumentError, "need full URI" unless %r{^http://}.match?(path)
unless @data.key? path
raise Gem::RemoteFetcher::FetchError.new("no data for #{path}", path)
@@ -141,7 +141,7 @@ class Gem::FakeFetcher
path = File.join path, name
- if source_uri =~ /^http/
+ if /^http/.match?(source_uri)
File.open(path, "wb") do |f|
f.write fetch_path(File.join(source_uri, "gems", name))
end