summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_commands_install_command.rb
diff options
context:
space:
mode:
authorJosef Šimánek <josef.simanek@gmail.com>2022-09-11 05:40:55 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-11-11 17:24:08 +0900
commitc7d043065c058f20ce30c61bb3ce127cb15cc0a8 (patch)
treedc36ca3f11e09451564500fa241fe3fdc521fde7 /test/rubygems/test_gem_commands_install_command.rb
parentceeefb5870c144ddc069b2c9b8a19dbd4947a947 (diff)
downloadruby-c7d043065c058f20ce30c61bb3ce127cb15cc0a8.tar.gz
[rubygems/rubygems] Add 'call for update' to RubyGems install command.
https://github.com/rubygems/rubygems/commit/05811f8248
Diffstat (limited to 'test/rubygems/test_gem_commands_install_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_install_command.rb b/test/rubygems/test_gem_commands_install_command.rb
index 7a58bcd7cb..14bddec485 100644
--- a/test/rubygems/test_gem_commands_install_command.rb
+++ b/test/rubygems/test_gem_commands_install_command.rb
@@ -1,5 +1,6 @@
# frozen_string_literal: true
require_relative "helper"
+require_relative "test_gem_update_suggestion"
require "rubygems/commands/install_command"
require "rubygems/request_set"
require "rubygems/rdoc"
@@ -1550,4 +1551,22 @@ ERROR: Possible alternatives: non_existent_with_hint
assert_equal " a-3", out.shift
assert_empty out
end
+
+ def test_suggest_update_if_enabled
+ TestUpdateSuggestion.with_eglible_environment(cmd: @cmd) do
+ spec_fetcher do |fetcher|
+ fetcher.gem "a", 2
+ end
+
+ @cmd.options[:args] = %w[a]
+
+ use_ui @ui do
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
+ @cmd.execute
+ end
+ end
+
+ assert_includes @ui.output, "A new release of RubyGems is available: 1.2.3 → 2.0.0!"
+ end
+ end
end