Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github
hub
提交
3474764e
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 搜索 >>
提交
3474764e
编写于
7月 27, 2014
作者:
M
Mislav Marohnić
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Port `hub cherry-pick` tests to cukes
上级
2200d937
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
49 addition
and
45 deletion
+49
-45
features/cherry_pick.feature
features/cherry_pick.feature
+49
-0
test/hub_test.rb
test/hub_test.rb
+0
-45
未找到文件。
features/cherry_pick.feature
0 → 100644
浏览文件 @
3474764e
Feature
:
hub cherry-pick
Background
:
Given I am in "git
:
//github.com/rtomayko/ronn.git"
git
repo
And
I am
"mislav"
on github.com with OAuth token
"OTOKEN"
Scenario
:
Unchanged
When
I run `hub cherry-pick a319d88`
Then
the git command should be unchanged
Scenario
:
From GitHub commit URL
When I run `hub cherry-pick https
:
//github.com/rtomayko/ronn/commit/a319d88
#comments`
Then
"git fetch origin"
should be run
And
"git cherry-pick a319d88"
should be run
Scenario
:
From fork that has existing remote
Given the "mislav" remote has url "git@github.com
:
mislav/ronn.git"
When I run `hub cherry-pick https
:
//github.com/mislav/ronn/commit/a319d88`
Then
"git fetch mislav"
should be run
And
"git cherry-pick a319d88"
should be run
Scenario
:
Using GitHub owner@SHA notation
Given the "mislav" remote has url "git@github.com
:
mislav/ronn.git"
When
I run `hub cherry-pick mislav@a319d88`
Then
"git fetch mislav"
should be run
And
"git cherry-pick a319d88"
should be run
Scenario
:
Using GitHub owner@SHA notation that is too short
When
I run `hub cherry-pick mislav@a319`
Then
the git command should be unchanged
Scenario
:
Unsupported GitHub owner/repo@SHA notation
When
I run `hub cherry-pick mislav/ronn@a319d88`
Then
the git command should be unchanged
Scenario
:
Skips processing if `-m/--mainline` is specified
When
I run `hub cherry-pick -m 42 mislav@a319d88`
Then
the git command should be unchanged
When
I run `hub cherry-pick --mainline 42 mislav@a319d88`
Then
the git command should be unchanged
Scenario
:
Using GitHub owner@SHA notation with remote add
When
I run `hub cherry-pick mislav@a319d88`
Then "git remote add -f mislav git
:
//github.com/mislav/ronn.git"
should
be
run
And
"git cherry-pick a319d88"
should be run
Scenario
:
From fork that doesn't have a remote
When I run `hub cherry-pick https
:
//github.com/jingweno/ronn/commit/a319d88`
Then "git remote add -f jingweno git
:
//github.com/jingweno/ronn.git"
should
be
run
And
"git cherry-pick a319d88"
should be run
test/hub_test.rb
浏览文件 @
3474764e
...
...
@@ -116,51 +116,6 @@ class HubTest < Minitest::Test
WebMock
.
reset!
end
def
test_cherry_pick
assert_forwarded
"cherry-pick a319d88"
end
def
test_cherry_pick_url
url
=
'http://github.com/mislav/hub/commit/a319d88'
assert_commands
"git fetch mislav"
,
"git cherry-pick a319d88"
,
"cherry-pick
#{
url
}
"
end
def
test_cherry_pick_url_with_fragment
url
=
'http://github.com/mislav/hub/commit/abcdef0123456789#comments'
assert_commands
"git fetch mislav"
,
"git cherry-pick abcdef0123456789"
,
"cherry-pick
#{
url
}
"
end
def
test_cherry_pick_url_with_remote_add
url
=
'https://github.com/xoebus/hub/commit/a319d88'
assert_commands
"git remote add -f xoebus git://github.com/xoebus/hub.git"
,
"git cherry-pick a319d88"
,
"cherry-pick
#{
url
}
"
end
def
test_cherry_pick_origin_url
url
=
'https://github.com/defunkt/hub/commit/a319d88'
assert_commands
"git fetch origin"
,
"git cherry-pick a319d88"
,
"cherry-pick
#{
url
}
"
end
def
test_cherry_pick_github_user_notation
assert_commands
"git fetch mislav"
,
"git cherry-pick 368af20"
,
"cherry-pick mislav@368af20"
end
def
test_cherry_pick_github_user_repo_notation
# not supported
assert_forwarded
"cherry-pick mislav/hubbub@a319d88"
end
def
test_cherry_pick_github_notation_too_short
assert_forwarded
"cherry-pick mislav@a319"
end
def
test_cherry_pick_github_notation_with_remote_add
assert_commands
"git remote add -f xoebus git://github.com/xoebus/hub.git"
,
"git cherry-pick a319d88"
,
"cherry-pick xoebus@a319d88"
end
def
test_pullrequest_alias
out
=
hub
(
'e-note'
)
assert_equal
hub
(
'pull-request'
),
out
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录