提交 00b846af 编写于 作者: M Mislav Marohnić

Backport cukes from 1.12-stable branch

上级 a0835d44
......@@ -13,6 +13,11 @@ Feature: hub compare
Then there should be no output
And "open https://github.com/mislav/dotfiles/compare/feature/foo" should be run
Scenario: Compare branch with funky characters
When I successfully run `hub compare 'my#branch!with.special+chars'`
Then there should be no output
And "open https://github.com/mislav/dotfiles/compare/my%23branch!with.special%2Bchars" should be run
Scenario: No args, no upstream
When I run `hub compare`
Then the exit status should be 1
......@@ -38,6 +43,13 @@ Feature: hub compare
Then there should be no output
And "open https://github.com/mislav/dotfiles/compare/experimental" should be run
Scenario: Current branch has funky characters
Given I am on the "feature" branch with upstream "origin/my#branch!with.special+chars"
And git "push.default" is set to "upstream"
When I successfully run `hub compare`
Then there should be no output
And "open https://github.com/mislav/dotfiles/compare/my%23branch!with.special%2Bchars" should be run
Scenario: Compare range
When I successfully run `hub compare 1.0...fix`
Then there should be no output
......
......@@ -98,6 +98,17 @@ Feature: hub create
When I successfully run `hub create`
Then the url for "origin" should be "git://github.com/mislav/dotfiles.git"
Scenario: Another remote already exists
Given the GitHub API server:
"""
post('/user/repos') {
json :full_name => 'mislav/dotfiles'
}
"""
And the "github" remote has url "git://github.com/mislav/dotfiles.git"
When I successfully run `hub create`
Then the url for "origin" should be "git@github.com:mislav/dotfiles.git"
Scenario: GitHub repo already exists
Given the GitHub API server:
"""
......
......@@ -587,11 +587,11 @@ Feature: hub pull-request
Scenario: Branch with quotation mark in name
Given I am on the "feat'ure" branch with upstream "origin/feat'ure"
Given the GitHub API server:
"""
post('/repos/mislav/coral/pulls') {
assert :head => "mislav:feat'ure"
json :html_url => "the://url"
}
"""
"""
post('/repos/mislav/coral/pulls') {
assert :head => "mislav:feat'ure"
json :html_url => "the://url"
}
"""
When I successfully run `hub pull-request -m hereyougo`
Then the output should contain exactly "the://url\n"
Feature: hub remote add
Background:
Given I am in "dotfiles" git repo
Given I am "EvilChelu" on GitHub.com
And I am in "dotfiles" git repo
Scenario: Add origin remote for my own repo
Given I am "mislav" on GitHub.com
And there are no remotes
Given there are no remotes
When I successfully run `hub remote add origin`
Then the url for "origin" should be "git://github.com/mislav/dotfiles.git"
And there should be no output
Scenario: Add private origin remote for my own repo
Given I am "mislav" on GitHub.com
And there are no remotes
When I successfully run `hub remote add -p origin`
Then the url for "origin" should be "git@github.com:mislav/dotfiles.git"
Then the url for "origin" should be "git@github.com:EvilChelu/dotfiles.git"
And there should be no output
Scenario: Unchanged public remote add
......@@ -58,6 +51,11 @@ Feature: hub remote add
Then the url for "mislav" should be "git@github.com:mislav/dotfiles.git"
And there should be no output
Scenario: Remote for my own repo is automatically private
When I successfully run `hub remote add evilchelu`
Then the url for "evilchelu" should be "git@github.com:EvilChelu/dotfiles.git"
And there should be no output
Scenario: Add remote with arguments
When I successfully run `hub remote add -f mislav`
Then "git remote add -f mislav git://github.com/mislav/dotfiles.git" should be run
......@@ -104,3 +102,8 @@ Feature: hub remote add
When I successfully run `hub remote add -p mm mislav/dotfilez.js`
Then the url for "mm" should be "git@github.com:mislav/dotfilez.js.git"
And there should be no output
Scenario: Add named private remote for my own repo including repo name
When I successfully run `hub remote add ec evilchelu/dotfilez.js`
Then the url for "ec" should be "git@github.com:EvilChelu/dotfilez.js.git"
And there should be no output
......@@ -16,6 +16,11 @@ Feature: hub submodule add
When I successfully run `hub submodule add -p mojombo/grit vendor/grit`
Then the "vendor/grit" submodule url should be "git@github.com:mojombo/grit.git"
Scenario: A submodule for my own repo is public nevertheless
Given I am "EvilChelu" on GitHub.com
When I successfully run `hub submodule add grit vendor/grit`
Then the "vendor/grit" submodule url should be "git://github.com/EvilChelu/grit.git"
Scenario: Add submodule with arguments
When I successfully run `hub submodule add -b foo --name grit mojombo/grit vendor/grit`
Then "git submodule add -b foo --name grit git://github.com/mojombo/grit.git vendor/grit" should be run
......
......@@ -3,6 +3,16 @@ require 'fileutils'
require 'forwardable'
require 'tmpdir'
# Ruby 2.2.0 compat
Cucumber::Ast::Step.class_eval do
undef_method :text_length
def text_length(name=name())
self.class::INDENT + self.class::INDENT +
keyword.unpack('U*').length +
name.unpack('U*').length
end
end
system_git = `which git 2>/dev/null`.chomp
lib_dir = File.expand_path('../../../lib', __FILE__)
bin_dir = File.expand_path('../fakebin', __FILE__)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册