提交 90a4f3d7 编写于 作者: M Madhusudan.C.S 提交者: Madhusudan.C.S

Add a cucumber test to verify that pull-request works with fetch-only upstream remote.

上级 29317d28
......@@ -643,3 +643,19 @@ Feature: hub pull-request
"""
When I successfully run `hub pull-request -m hereyougo -l feature,release`
Then the output should contain exactly "the://url\n"
Scenario: Pull request to a fetch-only upstream
Given the "upstream" remote has url "git://github.com/github/coral.git"
And the "upstream" remote has push url "no_push"
And I am on the "master" branch pushed to "origin/master"
Given the GitHub API server:
"""
post('/repos/github/coral/pulls') {
assert :base => 'master',
:head => 'mislav:master',
:title => 'hereyougo'
json :html_url => "the://url"
}
"""
When I successfully run `hub pull-request -m hereyougo`
Then the output should contain exactly "the://url\n"
......@@ -17,12 +17,15 @@ Given(/^git "(.+?)" is set to "(.+?)"$/) do |key, value|
run_silent %(git config #{key} "#{value}")
end
Given(/^the "([^"]*)" remote has url "([^"]*)"$/) do |remote_name, url|
Given(/^the "([^"]*)" remote has(?: (push))? url "([^"]*)"$/) do |remote_name, push, url|
remotes = run_silent('git remote').split("\n")
if push
push = "--push"
end
unless remotes.include? remote_name
run_silent %(git remote add #{remote_name} "#{url}")
else
run_silent %(git remote set-url #{remote_name} "#{url}")
run_silent %(git remote set-url #{push} #{remote_name} "#{url}")
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册