Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github
hub
提交
1a0c52bb
H
hub
项目概览
github
/
hub
9 个月 前同步成功
通知
3
Star
22523
Fork
2406
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1a0c52bb
编写于
7月 25, 2014
作者:
M
Mislav Marohnić
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Port `hub browse` SSH-related scenarios to cukes
上级
fefefa20
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
20 deletion
+28
-20
features/browse.feature
features/browse.feature
+21
-0
features/steps.rb
features/steps.rb
+7
-1
test/hub_test.rb
test/hub_test.rb
+0
-19
未找到文件。
features/browse.feature
浏览文件 @
1a0c52bb
...
...
@@ -173,3 +173,24 @@ Feature: hub browse
And
"git.my.org"
is a whitelisted Enterprise host
When
I successfully run `hub browse`
Then "open http
:
//git.my.org/mislav/dotfiles"
should
be
run
Scenario
:
SSH alias
Given the SSH config
:
"""
Host gh
User git
HostName github.com
"""
Given I am in "gh
:
singingwolfboy/sekrit.git"
git
repo
When
I successfully run `hub browse`
Then "open https
:
//github.com/singingwolfboy/sekrit"
should
be
run
Scenario
:
SSH GitHub alias
Given the SSH config
:
"""
Host github.com
HostName ssh.github.com
"""
Given I am in "git@github.com
:
suan/git-sanity.git"
git
repo
When
I successfully run `hub browse`
Then "open https
:
//github.com/suan/git-sanity"
should
be
run
features/steps.rb
浏览文件 @
1a0c52bb
...
...
@@ -41,7 +41,7 @@ Given(/^\$(\w+) is "([^"]*)"$/) do |name, value|
end
Given
(
/^I am in "([^"]*)" git repo$/
)
do
|
dir_name
|
if
dir_name
.
include?
'://'
if
dir_name
.
include?
(
':'
)
origin_url
=
dir_name
dir_name
=
File
.
basename
origin_url
,
'.git'
end
...
...
@@ -239,3 +239,9 @@ end
Given
(
/^the git commit editor is "([^"]+)"$/
)
do
|
cmd
|
set_env
(
'GIT_EDITOR'
,
cmd
)
end
Given
(
/^the SSH config:$/
)
do
|
config_lines
|
ssh_config
=
"
#{
ENV
[
'HOME'
]
}
/.ssh/config"
FileUtils
.
mkdir_p
(
File
.
dirname
(
ssh_config
))
File
.
open
(
ssh_config
,
'w'
)
{
|
f
|
f
<<
config_lines
}
end
test/hub_test.rb
浏览文件 @
1a0c52bb
...
...
@@ -267,25 +267,6 @@ class HubTest < Minitest::Test
assert_includes
'This file is generated code'
,
hub
(
"hub standalone"
)
end
def
test_hub_browse_no_repo
stub_repo_url
(
nil
)
assert_equal
"Usage: hub browse [<USER>/]<REPOSITORY>
\n
"
,
hub
(
"browse"
)
end
def
test_hub_browse_ssh_alias
with_ssh_config
"Host gh
\n
User git
\n
HostName github.com"
do
stub_repo_url
"gh:singingwolfboy/sekrit.git"
assert_command
"browse"
,
"open https://github.com/singingwolfboy/sekrit"
end
end
def
test_hub_browse_ssh_github_alias
with_ssh_config
"Host github.com
\n
HostName ssh.github.com"
do
stub_repo_url
"git@github.com:suan/git-sanity.git"
assert_command
"browse"
,
"open https://github.com/suan/git-sanity"
end
end
def
test_custom_browser
with_browser_env
(
"custom"
)
do
assert_browser
(
"custom"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录