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

[pr show] reformat tests

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