提交 e48d374b 编写于 作者: C Chris Wanstrath

basic `hub install <shell>` support

上级 64168edd
......@@ -80,6 +80,26 @@ module Hub
end
end
def install(args)
shells = {
'sh' => 'alias git=hub',
'bash' => 'alias git=hub',
'zsh' => 'alias git=hub',
'csh' => 'alias git hub',
'fish' => 'alias git hub'
}
shell = args[1]
if shells[shell]
puts shells[shell]
else
abort "fatal: never heard of `#{shell}'"
end
exit
end
# $ hub version
# > git version
# (print hub version)
......
$LOAD_PATH.unshift File.dirname(__FILE__)
require 'helper'
class InstallTest < Test::Unit::TestCase
def test_install_bash
assert_equal "alias git=hub\n", hub("install bash")
end
def test_install_sh
assert_equal "alias git=hub\n", hub("install sh")
end
def test_install_zsh
assert_equal "alias git=hub\n", hub("install zsh")
end
def test_install_csh
assert_equal "alias git hub\n", hub("install csh")
end
def test_install_fish
assert_equal "alias git hub\n", hub("install fish")
end
def test_install_blah
assert_equal "fatal: never heard of `blah'\n", hub("install blah")
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册