summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_update_suggestion.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-03-16 14:10:30 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-03-17 18:50:55 +0900
commit72d09a568f9f50ce7c41ef2999d272f77a207a8c (patch)
treeaeb539d5e35ea0ad2ee7880f30d5095afdd7bf34 /test/rubygems/test_gem_update_suggestion.rb
parenta532e9dc37bb7ff2fb36966327f71a74163d9616 (diff)
[rubygems/rubygems] util/rubocop -A --only Style/RedundantBegin
https://github.com/rubygems/rubygems/commit/b595d3cf0f
Diffstat (limited to 'test/rubygems/test_gem_update_suggestion.rb')
-rw-r--r--test/rubygems/test_gem_update_suggestion.rb36
1 files changed, 15 insertions, 21 deletions
diff --git a/test/rubygems/test_gem_update_suggestion.rb b/test/rubygems/test_gem_update_suggestion.rb
index 19764d972e..ae8f103440 100644
--- a/test/rubygems/test_gem_update_suggestion.rb
+++ b/test/rubygems/test_gem_update_suggestion.rb
@@ -145,25 +145,21 @@ class TestUpdateSuggestion < Gem::TestCase
def test_eglible_for_update_prevent_config
with_eglible_environment(cmd: @cmd) do
- begin
- original_config = Gem.configuration[:prevent_update_suggestion]
- Gem.configuration[:prevent_update_suggestion] = true
- refute @cmd.eglible_for_update?
- ensure
- Gem.configuration[:prevent_update_suggestion] = original_config
- end
+ original_config = Gem.configuration[:prevent_update_suggestion]
+ Gem.configuration[:prevent_update_suggestion] = true
+ refute @cmd.eglible_for_update?
+ ensure
+ Gem.configuration[:prevent_update_suggestion] = original_config
end
end
def test_eglible_for_update_prevent_env
with_eglible_environment(cmd: @cmd) do
- begin
- original_env = ENV["RUBYGEMS_PREVENT_UPDATE_SUGGESTION"]
- ENV["RUBYGEMS_PREVENT_UPDATE_SUGGESTION"] = "yes"
- refute @cmd.eglible_for_update?
- ensure
- ENV["RUBYGEMS_PREVENT_UPDATE_SUGGESTION"] = original_env
- end
+ original_env = ENV["RUBYGEMS_PREVENT_UPDATE_SUGGESTION"]
+ ENV["RUBYGEMS_PREVENT_UPDATE_SUGGESTION"] = "yes"
+ refute @cmd.eglible_for_update?
+ ensure
+ ENV["RUBYGEMS_PREVENT_UPDATE_SUGGESTION"] = original_env
end
end
@@ -181,13 +177,11 @@ class TestUpdateSuggestion < Gem::TestCase
def test_eglible_for_update_disabled_update
with_eglible_environment(cmd: @cmd) do
- begin
- original_disable = Gem.disable_system_update_message
- Gem.disable_system_update_message = "disabled"
- refute @cmd.eglible_for_update?
- ensure
- Gem.disable_system_update_message = original_disable
- end
+ original_disable = Gem.disable_system_update_message
+ Gem.disable_system_update_message = "disabled"
+ refute @cmd.eglible_for_update?
+ ensure
+ Gem.disable_system_update_message = original_disable
end
end