[前][次][番号順一覧][スレッド一覧]

ruby-changes:72432

From: Brian <ko1@a...>
Date: Wed, 6 Jul 2022 02:59:27 +0900 (JST)
Subject: [ruby-changes:72432] 902d1a5c51 (master): [rubygems/rubygems] add message when gems are requested to be updated but they are not installed

https://git.ruby-lang.org/ruby.git/commit/?id=902d1a5c51

From 902d1a5c513ed6e49e7f577ffe7146d30798b3e9 Mon Sep 17 00:00:00 2001
From: Brian Le <brian.le@s...>
Date: Thu, 30 Jun 2022 16:20:53 -0700
Subject: [rubygems/rubygems] add message when gems are requested to be updated
 but they are not installed

https://github.com/rubygems/rubygems/commit/27953ffe9a
---
 lib/rubygems/commands/update_command.rb           |  1 +
 test/rubygems/test_gem_commands_update_command.rb | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb
index 59e020fd63..04ce0ea935 100644
--- a/lib/rubygems/commands/update_command.rb
+++ b/lib/rubygems/commands/update_command.rb
@@ -130,6 +130,7 @@ command to remove old versions. https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/update_command.rb#L130
       say "Gems updated: #{updated_names.join(' ')}"
     end
     say "Gems already up-to-date: #{up_to_date_names.join(' ')}" unless up_to_date_names.empty?
+    say "Gems not currently installed: #{not_installed_names.join(' ')}" unless not_installed_names.empty?
   end
 
   def fetch_remote_gems(spec) # :nodoc:
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb
index acb60a7583..1d8dcb2e64 100644
--- a/test/rubygems/test_gem_commands_update_command.rb
+++ b/test/rubygems/test_gem_commands_update_command.rb
@@ -812,4 +812,24 @@ class TestGemCommandsUpdateCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_update_command.rb#L812
     assert_equal "  a-2", out.shift
     assert_empty out
   end
+
+  def test_execute_named_not_installed_and_no_update
+    spec_fetcher do |fetcher|
+      fetcher.spec 'a', 2
+    end
+
+    @cmd.options[:args] = %w[a b]
+
+    use_ui @ui do
+      @cmd.execute
+    end
+
+    out = @ui.output.split "\n"
+    assert_equal "Updating installed gems", out.shift
+    assert_equal "Nothing to update", out.shift
+    assert_equal "Gems already up-to-date: a", out.shift
+    assert_equal "Gems not currently installed: b", out.shift
+
+    assert_empty out
+  end
 end
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]