summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_commands_help_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_commands_help_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_help_command.rb17
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)