Commit 33b60b6d authored by Samuel E. Giddins's avatar Samuel E. Giddins

[Command] Remove Pod::Command::Help

Closes #2156.
parent 0c80af37
......@@ -7,7 +7,6 @@ module Pod
end
class Command < CLAide::Command
require 'cocoapods/command/help'
require 'cocoapods/command/inter_process_communication'
require 'cocoapods/command/lib'
require 'cocoapods/command/list'
......
module Pod
class Command
class Help < Command
self.summary = 'Show help for the given command.'
self.arguments = [
CLAide::Argument.new('COMMAND', false),
]
def initialize(argv)
@help_command = Pod::Command.parse(argv)
super
end
def run
help_command.help!
end
private
attr_reader :help_command
end
end
end
require File.expand_path('../../../spec_helper', __FILE__)
module Pod
describe 'Command::Help' do
extend SpecHelper::Command
it 'invokes the right command with --help flag' do
command = command('help', 'repo', 'push')
command.send(:help_command).should.be.instance_of Pod::Command::Repo::Push
lambda { command.run }.should.raise CLAide::Help
end
it 'raises help! if no other command is passed' do
lambda { command('help').run }.should.raise CLAide::Help
end
it 'shows the right usage' do
args = [CLAide::Argument.new('COMMAND', false)]
Pod::Command::Help.arguments.should.equal args
end
end
end
......@@ -3,7 +3,6 @@ require File.expand_path('../../spec_helper', __FILE__)
module Pod
describe Command do
it 'returns the proper command class' do
Command.parse(%w( help )).should.be.instance_of Command::Help
Command.parse(%w( install )).should.be.instance_of Command::Install
Command.parse(%w( list )).should.be.instance_of Command::List
Command.parse(%w( outdated )).should.be.instance_of Command::Outdated
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment