diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-03-16 13:47:12 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-03-17 18:50:55 +0900 |
commit | 6ad269dc39ab6bdf7ef195a048fa10b642374826 (patch) | |
tree | 6ba6dfbc3b6ecd67a10ae2cd4c8b5c6428838ce8 /test/rubygems | |
parent | 70164eec0f48a691dd039f55ac897036aa32e5cf (diff) | |
download | ruby-6ad269dc39ab6bdf7ef195a048fa10b642374826.tar.gz |
[rubygems/rubygems] util/rubocop -A --only Style/RescueStandardError
https://github.com/rubygems/rubygems/commit/80b57da926
Diffstat (limited to 'test/rubygems')
-rw-r--r-- | test/rubygems/helper.rb | 4 | ||||
-rw-r--r-- | test/rubygems/test_gem.rb | 12 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_exec_command.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_uninstall_command.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_installer.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_remote_fetcher.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_specification.rb | 2 |
7 files changed, 13 insertions, 13 deletions
diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb index c3a1454012..c90f581331 100644 --- a/test/rubygems/helper.rb +++ b/test/rubygems/helper.rb @@ -345,7 +345,7 @@ class Gem::TestCase < Test::Unit::TestCase $LOAD_PATH.map! do |s| expand_path = begin File.realpath(s) - rescue + rescue StandardError File.expand_path(s) end if expand_path != s @@ -1527,7 +1527,7 @@ Also, a list: def self.cert_path(cert_name) if begin Time.at(2**32) - rescue + rescue StandardError 32 end == 32 cert_file = "#{__dir__}/#{cert_name}_cert_32.pem" diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index c86ccc2098..b32a76807b 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -664,7 +664,7 @@ class TestGem < Gem::TestCase gemdir = File.join @tempdir, "a/b/c/gemdir" begin FileUtils.rm_rf File.join(@tempdir, "a") - rescue + rescue StandardError nil end refute File.exist?(File.join(@tempdir, "a")), @@ -681,7 +681,7 @@ class TestGem < Gem::TestCase gemdir = File.join @tempdir, "egd" begin FileUtils.rm_r gemdir - rescue + rescue StandardError nil end refute File.exist?(gemdir), "manually remove #{gemdir}, tests are broken" @@ -702,7 +702,7 @@ class TestGem < Gem::TestCase begin FileUtils.rm_r parent - rescue + rescue StandardError nil end refute File.exist?(parent), "manually remove #{parent}, tests are broken" @@ -1510,7 +1510,7 @@ class TestGem < Gem::TestCase with_plugin("load") { Gem.load_env_plugins } begin assert_equal :loaded, TEST_PLUGIN_LOAD - rescue + rescue StandardError nil end @@ -1520,7 +1520,7 @@ class TestGem < Gem::TestCase with_plugin("standarderror") { Gem.load_env_plugins } begin assert_equal :loaded, TEST_PLUGIN_STANDARDERROR - rescue + rescue StandardError nil end @@ -1530,7 +1530,7 @@ class TestGem < Gem::TestCase with_plugin("exception") { Gem.load_env_plugins } begin assert_equal :loaded, TEST_PLUGIN_EXCEPTION - rescue + rescue StandardError nil end end diff --git a/test/rubygems/test_gem_commands_exec_command.rb b/test/rubygems/test_gem_commands_exec_command.rb index 532f8acef0..fd899dbd55 100644 --- a/test/rubygems/test_gem_commands_exec_command.rb +++ b/test/rubygems/test_gem_commands_exec_command.rb @@ -732,7 +732,7 @@ class TestGemCommandsExecCommand < Gem::TestCase begin invoke "gem", "uninstall", "--verbose", "-x", "a" - rescue + rescue StandardError nil end refute_includes @ui.output, "running gem exec with" diff --git a/test/rubygems/test_gem_commands_uninstall_command.rb b/test/rubygems/test_gem_commands_uninstall_command.rb index 3318045ca0..1b6588e854 100644 --- a/test/rubygems/test_gem_commands_uninstall_command.rb +++ b/test/rubygems/test_gem_commands_uninstall_command.rb @@ -157,7 +157,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase @cmd.execute assert_equal false, File.exist?(formatted_executable) - rescue + rescue StandardError Gem::Installer.exec_format = nil end diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb index 9a71f4eae5..ba30a06080 100644 --- a/test/rubygems/test_gem_installer.rb +++ b/test/rubygems/test_gem_installer.rb @@ -1567,7 +1567,7 @@ gem 'other', version installer.install end assert_path_exist so - rescue + rescue StandardError puts "-" * 78 puts File.read File.join(@gemhome, "gems", "a-2", "Makefile") puts "-" * 78 diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb index 1faf62957a..d512094eff 100644 --- a/test/rubygems/test_gem_remote_fetcher.rb +++ b/test/rubygems/test_gem_remote_fetcher.rb @@ -363,7 +363,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== FileUtils.chmod 0555, @a1.cache_dir begin FileUtils.mkdir_p File.join(Gem.user_dir, "cache") - rescue + rescue StandardError nil end FileUtils.chmod 0555, File.join(Gem.user_dir, "cache") diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index eaeddd29c8..c1965487db 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -3465,7 +3465,7 @@ Did you mean 'Ruby'? capture_output do Gem::Specification.load(specfile.path) end - rescue => e + rescue StandardError => e name_rexp = Regexp.new(Regexp.escape(specfile.path)) assert e.backtrace.grep(name_rexp).any? end |