diff options
| author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-03-22 12:25:40 +0900 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-03-23 17:18:49 +0900 |
| commit | 1a600126126e2f531377646e929280c756e69929 (patch) | |
| tree | b5880e41993fbabf1edb9c11348ea0dc5e6378c7 /test | |
| parent | 25ed2e7415ded52837e3ade1b43efe1def9493d2 (diff) | |
[rubygems/rubygems] util/rubocop -A --only Lint/RescueException
https://github.com/rubygems/rubygems/commit/e8a5db50af
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7582
Diffstat (limited to 'test')
| -rw-r--r-- | test/rubygems/plugin/scripterror/rubygems_plugin.rb (renamed from test/rubygems/plugin/exception/rubygems_plugin.rb) | 2 | ||||
| -rw-r--r-- | test/rubygems/test_gem.rb | 2 | ||||
| -rw-r--r-- | test/rubygems/test_gem_ext_cargo_builder.rb | 4 | ||||
| -rw-r--r-- | test/rubygems/test_gem_remote_fetcher.rb | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/test/rubygems/plugin/exception/rubygems_plugin.rb b/test/rubygems/plugin/scripterror/rubygems_plugin.rb index f54e689d87..7479906ff5 100644 --- a/test/rubygems/plugin/exception/rubygems_plugin.rb +++ b/test/rubygems/plugin/scripterror/rubygems_plugin.rb @@ -1,3 +1,3 @@ # frozen_string_literal: true TestGem::TEST_PLUGIN_EXCEPTION = :loaded -raise Exception.new("boom") +raise ScriptError.new("boom") diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index da0b0a4c29..bfa896b2ee 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -1527,7 +1527,7 @@ class TestGem < Gem::TestCase util_remove_interrupt_command # Should attempt to cause an Exception - with_plugin("exception") { Gem.load_env_plugins } + with_plugin("scripterror") { Gem.load_env_plugins } begin assert_equal :loaded, TEST_PLUGIN_EXCEPTION rescue StandardError diff --git a/test/rubygems/test_gem_ext_cargo_builder.rb b/test/rubygems/test_gem_ext_cargo_builder.rb index de85a60711..614ae9eeaf 100644 --- a/test/rubygems/test_gem_ext_cargo_builder.rb +++ b/test/rubygems/test_gem_ext_cargo_builder.rb @@ -41,7 +41,7 @@ class TestGemExtCargoBuilder < Gem::TestCase assert_match(/Finished/, output) assert_match(/release/, output) assert_ffi_handle bundle, "Init_rust_ruby_example" - rescue Exception => e + rescue StandardError => e pp output if output raise(e) @@ -67,7 +67,7 @@ class TestGemExtCargoBuilder < Gem::TestCase assert_ffi_handle bundle, "hello_from_rubygems" assert_ffi_handle bundle, "hello_from_rubygems_version" refute_ffi_handle bundle, "should_never_exist" - rescue Exception => e + rescue StandardError => e pp output if output raise(e) diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb index 088acad841..a9937afecc 100644 --- a/test/rubygems/test_gem_remote_fetcher.rb +++ b/test/rubygems/test_gem_remote_fetcher.rb @@ -1158,7 +1158,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== server.ssl_context.tmp_dh_callback = proc { TEST_KEY_DH2048 } t = Thread.new do server.start - rescue Exception => ex + rescue StandardError => ex puts "ERROR during server thread: #{ex.message}" raise ensure @@ -1210,7 +1210,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== end th = Thread.new do s.start - rescue Exception => ex + rescue StandardError => ex abort "ERROR during server thread: #{ex.message}" ensure s.shutdown |
