diff options
author | Josef Šimánek <[email protected]> | 2020-06-14 00:26:23 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2020-06-15 21:20:37 +0900 |
commit | 3ab1cfc325811b862cb81d0360bf83216cd6f235 (patch) | |
tree | d2a28c09fa9c70fbba90a9cd62cde5fa10629305 /test | |
parent | 49c42b6012264890bedb572e5e0c6fc4750aaf9a (diff) |
Add Gem.disable_system_update_message to disable gem update --system if needed.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3229
Diffstat (limited to 'test')
-rw-r--r-- | test/rubygems/test_gem_commands_update_command.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb index efaa621634..3b823a047f 100644 --- a/test/rubygems/test_gem_commands_update_command.rb +++ b/test/rubygems/test_gem_commands_update_command.rb @@ -238,6 +238,23 @@ class TestGemCommandsUpdateCommand < Gem::TestCase @ui.error end + def test_execute_system_with_disabled_update + old_disable_system_update_message = Gem.disable_system_update_message + Gem.disable_system_update_message = "Please use package manager instead." + + @cmd.options[:args] = [] + @cmd.options[:system] = true + + use_ui @ui do + @cmd.execute + end + + assert_empty @ui.output + assert_equal "ERROR: Please use package manager instead.\n", @ui.error + ensure + Gem.disable_system_update_message = old_disable_system_update_message + end + # before: # a1 -> c1.2 # after: |