diff options
Diffstat (limited to 'test/rubygems/test_gem_commands_install_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_install_command.rb | 19 |
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 |