提交 928b40de 编写于 作者: M Mislav Marohnić

[pr show] reformat tests

上级 94952119
Feature: hub pr show
Background:
Given I am in "git://github.com/ashemesh/hub.git" git repo
And I am "ashemesh" on github.com with OAuth token "OTOKEN"
Background:
Given I am in "git://github.com/ashemesh/hub.git" git repo
And I am "ashemesh" on github.com with OAuth token "OTOKEN"
Scenario: Open Current Branch Pull Request
Given I am on the "topic" branch
Given the GitHub API server:
"""
get('/repos/ashemesh/hub/pulls'){
assert :state => "open",
:head => "ashemesh:topic"
json [
{
:html_url => "https://github.com/ashemesh/hub/pull/1",
},
]
}
"""
When I successfully run `hub pr show`
Then "open https://github.com/ashemesh/hub/pull/1" should be run
Scenario: Current branch
Given I am on the "topic" branch
Given the GitHub API server:
"""
get('/repos/ashemesh/hub/pulls'){
assert :state => "open",
:head => "ashemesh:topic"
json [
{ :html_url => "https://github.com/ashemesh/hub/pull/102" },
]
}
"""
When I successfully run `hub pr show`
Then "open https://github.com/ashemesh/hub/pull/102" should be run
Scenario: Current branch output URL
Given I am on the "topic" branch
Given the GitHub API server:
"""
get('/repos/ashemesh/hub/pulls'){
assert :state => "open",
:head => "ashemesh:topic"
json [
{ :html_url => "https://github.com/ashemesh/hub/pull/102" },
]
}
"""
When I successfully run `hub pr show -u`
Then "open https://github.com/ashemesh/hub/pull/102" should not be run
And the output should contain exactly:
"""
https://github.com/ashemesh/hub/pull/102\n
"""
Scenario: Open Current Branch Pull Request In Upstream
Given the "upstream" remote has url "git@github.com:github/hub.git"
Scenario: Current branch in fork
Given the "upstream" remote has url "git@github.com:github/hub.git"
And I am on the "topic" branch
Given the GitHub API server:
"""
get('/repos/github/hub/pulls'){
assert :state => "open",
:head => "ashemesh:topic"
json [
{
:html_url => "https://github.com/github/hub/pull/1",
},
]
}
"""
"""
get('/repos/github/hub/pulls'){
assert :state => "open",
:head => "ashemesh:topic"
json [
{ :html_url => "https://github.com/github/hub/pull/102" },
]
}
"""
When I successfully run `hub pr show`
Then "open https://github.com/github/hub/pull/1" should be run
Then "open https://github.com/github/hub/pull/102" should be run
Scenario: Open Pull Request For Given Head
Given the GitHub API server:
"""
get('/repos/ashemesh/hub/pulls'){
assert :state => "open",
:head => "ashemesh:topic"
json [
{
:html_url => "https://github.com/ashemesh/hub/pull/1",
},
]
}
"""
When I successfully run `hub pr show --head topic`
Then "open https://github.com/ashemesh/hub/pull/1" should be run
Scenario: Explicit head branch
Given the GitHub API server:
"""
get('/repos/ashemesh/hub/pulls'){
assert :state => "open",
:head => "ashemesh:topic"
json [
{ :html_url => "https://github.com/ashemesh/hub/pull/102" },
]
}
"""
When I successfully run `hub pr show --head topic`
Then "open https://github.com/ashemesh/hub/pull/102" should be run
Scenario: Open Pull Request In Fork Repository Given Head
Given the GitHub API server:
"""
get('/repos/ashemesh/hub'){
json :html_url => "https://github.com/ashemesh/hub",
:parent => {
:html_url => "https://github.com/github/hub",
:name => "hub",
:owner => { :login => "github" }
}
}
get('/repos/github/hub/pulls'){
assert :state => "open",
:head => "ashemesh:topic"
json [
{
:html_url => "https://github.com/github/hub/pull/1",
},
]
}
"""
When I successfully run `hub pr show --head ashemesh:topic`
Then "open https://github.com/github/hub/pull/1" should be run
Scenario: Explicit head branch with owner
Given the GitHub API server:
"""
get('/repos/ashemesh/hub/pulls'){
assert :state => "open",
:head => "github:topic"
json [
{ :html_url => "https://github.com/ashemesh/hub/pull/102" },
]
}
"""
When I successfully run `hub pr show --head github:topic`
Then "open https://github.com/ashemesh/hub/pull/102" should be run
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册