mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] add login & logout for the signin & signout commands respectively
49b491970b
This commit is contained in:
parent
e563c6068e
commit
9c0c66f721
2 changed files with 15 additions and 1 deletions
|
@ -74,6 +74,8 @@ class Gem::CommandManager
|
||||||
|
|
||||||
ALIAS_COMMANDS = {
|
ALIAS_COMMANDS = {
|
||||||
'i' => 'install',
|
'i' => 'install',
|
||||||
|
'login' => 'signin',
|
||||||
|
'logout' => 'signout',
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
|
@ -36,6 +36,18 @@ class TestGemCommandManager < Gem::TestCase
|
||||||
assert_kind_of Gem::Commands::InstallCommand, command
|
assert_kind_of Gem::Commands::InstallCommand, command
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_find_login_alias_command
|
||||||
|
command = @command_manager.find_command 'login'
|
||||||
|
|
||||||
|
assert_kind_of Gem::Commands::SigninCommand, command
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_find_logout_alias_comamnd
|
||||||
|
command = @command_manager.find_command 'logout'
|
||||||
|
|
||||||
|
assert_kind_of Gem::Commands::SignoutCommand, command
|
||||||
|
end
|
||||||
|
|
||||||
def test_find_command_ambiguous_exact
|
def test_find_command_ambiguous_exact
|
||||||
ins_command = Class.new
|
ins_command = Class.new
|
||||||
Gem::Commands.send :const_set, :InsCommand, ins_command
|
Gem::Commands.send :const_set, :InsCommand, ins_command
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue