diff options
author | loadkpi <loadkpi@gmail.com> | 2022-01-14 09:07:39 +0300 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-01-15 14:00:35 +0900 |
commit | 7c70151aedf5b51447f7a9ebcb6a4b58ef76deb2 (patch) | |
tree | 5c14424039b6acf08133a4231b89b639e4738cb1 /test/rubygems/test_gem_commands_update_command.rb | |
parent | 2dc365db79e46daaf415c4fcabeab540ec43e92e (diff) | |
download | ruby-7c70151aedf5b51447f7a9ebcb6a4b58ef76deb2.tar.gz |
[rubygems/rubygems] Fix `gem update --system` for already installed version of rubygems-update
https://github.com/rubygems/rubygems/commit/c167d513a7
Diffstat (limited to 'test/rubygems/test_gem_commands_update_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_update_command.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb index ce599d5812..c765e9a8df 100644 --- a/test/rubygems/test_gem_commands_update_command.rb +++ b/test/rubygems/test_gem_commands_update_command.rb @@ -157,6 +157,40 @@ class TestGemCommandsUpdateCommand < Gem::TestCase assert_empty out end + def test_execute_system_update_installed + spec_fetcher do |fetcher| + fetcher.download 'rubygems-update', 8 do |s| + s.files = %w[setup.rb] + end + end + + @cmd.options[:args] = [] + @cmd.options[:system] = true + + @cmd.execute + + spec_fetcher do |fetcher| + fetcher.download 'rubygems-update', 9 do |s| + s.files = %w[setup.rb] + end + end + + @cmd = Gem::Commands::UpdateCommand.new + @cmd.options[:args] = [] + @cmd.options[:system] = true + + use_ui @ui do + @cmd.execute + end + + out = @ui.output.split "\n" + assert_equal "Updating rubygems-update", out.shift + assert_equal "Installing RubyGems 9", out.shift + assert_equal "RubyGems system software updated", out.shift + + assert_empty out + end + def test_execute_system_specific spec_fetcher do |fetcher| fetcher.download 'rubygems-update', 8 do |s| |