2
require "rubygems/test_case"
3
require "rubygems/commands/help_command"
4
require "rubygems/format"
5
require "rubygems/command_manager"
7
class TestGemCommandsHelpCommand < Gem::TestCase
11
@cmd = Gem::Commands::HelpCommand.new
15
util_gem 'bad' do |out, err|
17
assert_match(/Unknown command bad. Try gem help commands\n/, err)
21
def test_gem_help_platforms
22
util_gem 'platforms' do |out, err|
23
assert_match(/x86-freebsd/, out)
28
def test_gem_help_commands
29
mgr = Gem::CommandManager.new
31
util_gem 'commands' do |out, err|
32
mgr.command_names.each do |cmd|
33
assert_match(/\s+#{cmd}\s+\S+/, out)
39
def test_gem_no_args_shows_help
40
util_gem do |out, err|
41
assert_match(/Usage:/, out)
42
assert_match(/gem install/, out)
48
@cmd.options[:args] = args
56
yield @ui.output, @ui.error