summaryrefslogtreecommitdiff
path: root/test/rubygems/helper.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-03-16 13:48:03 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-03-17 18:50:55 +0900
commit70164eec0f48a691dd039f55ac897036aa32e5cf (patch)
treee991dceeb7aa2d730d60ae8ca8ce512fa7517823 /test/rubygems/helper.rb
parentfef0313ec79beab2383e30062803a0f21b198b21 (diff)
[rubygems/rubygems] util/rubocop -A --only Style/RescueModifier
https://github.com/rubygems/rubygems/commit/b490379eab
Diffstat (limited to 'test/rubygems/helper.rb')
-rw-r--r--test/rubygems/helper.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb
index 4e738c3d40..c3a1454012 100644
--- a/test/rubygems/helper.rb
+++ b/test/rubygems/helper.rb
@@ -343,7 +343,11 @@ class Gem::TestCase < Test::Unit::TestCase
@orig_LOAD_PATH = $LOAD_PATH.dup
$LOAD_PATH.map! do |s|
- expand_path = File.realpath(s) rescue File.expand_path(s)
+ expand_path = begin
+ File.realpath(s)
+ rescue
+ File.expand_path(s)
+ end
if expand_path != s
expand_path.tap(&Gem::UNTAINT)
if s.instance_variable_defined?(:@gem_prelude_index)
@@ -1521,7 +1525,11 @@ Also, a list:
# <tt>test/rubygems/</tt>.
def self.cert_path(cert_name)
- if (Time.at(2**32) rescue 32) == 32
+ if begin
+ Time.at(2**32)
+ rescue
+ 32
+ end == 32
cert_file = "#{__dir__}/#{cert_name}_cert_32.pem"
return cert_file if File.exist? cert_file