diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-12-08 16:33:39 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-12-08 17:30:02 +0900 |
commit | 4aca77edde91f826aa243e268bf1ef5214530583 (patch) | |
tree | ef0cf1a95fcced00ca5fa40f3412c567bf95d705 /test/rubygems/test_gem_commands_help_command.rb | |
parent | 6a6a24df9b72750d12f9b15192bdb7517e668efb (diff) | |
download | ruby-4aca77edde91f826aa243e268bf1ef5214530583.tar.gz |
Merge prepare version of RubyGems 3.2.0
Diffstat (limited to 'test/rubygems/test_gem_commands_help_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_help_command.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/test/rubygems/test_gem_commands_help_command.rb b/test/rubygems/test_gem_commands_help_command.rb index 26e22d79be..8d20563a60 100644 --- a/test/rubygems/test_gem_commands_help_command.rb +++ b/test/rubygems/test_gem_commands_help_command.rb @@ -40,10 +40,12 @@ class TestGemCommandsHelpCommand < Gem::TestCase util_gem 'commands' do |out, err| mgr.command_names.each do |cmd| - assert_match(/\s+#{cmd}\s+\S+/, out) + unless mgr[cmd].deprecated? + assert_match(/\s+#{cmd}\s+\S+/, out) + end end - if defined?(OpenSSL::SSL) + if Gem::HAVE_OPENSSL assert_empty err refute_match 'No command found for ', out @@ -51,6 +53,17 @@ class TestGemCommandsHelpCommand < Gem::TestCase end end + def test_gem_help_commands_omits_deprecated_commands + mgr = Gem::CommandManager.new + + util_gem 'commands' do |out, err| + deprecated_commands = mgr.command_names.select {|cmd| mgr[cmd].deprecated? } + deprecated_commands.each do |cmd| + refute_match(/\A\s+#{cmd}\s+\S+\z/, out) + end + end + end + def test_gem_no_args_shows_help util_gem do |out, err| assert_match(/Usage:/, out) |