2012-05-04 19:13:59 +04:00
|
|
|
Feature: hub submodule add
|
|
|
|
Background:
|
2015-04-28 10:11:55 +03:00
|
|
|
Given I am "mislav" on github.com with OAuth token "OTOKEN"
|
2012-05-04 19:13:59 +04:00
|
|
|
Given I am in "dotfiles" git repo
|
|
|
|
# make existing repo in subdirectory so git clone isn't triggered
|
|
|
|
Given a git repo in "vendor/grit"
|
2019-08-21 18:29:33 +03:00
|
|
|
And I cd to "vendor/grit"
|
|
|
|
And I make 1 commit
|
|
|
|
And I cd to "../.."
|
2012-05-04 19:13:59 +04:00
|
|
|
|
|
|
|
Scenario: Add public submodule
|
2015-04-28 10:11:55 +03:00
|
|
|
Given the GitHub API server:
|
|
|
|
"""
|
|
|
|
get('/repos/mojombo/grit') {
|
|
|
|
json :private => false,
|
2016-08-08 14:44:07 +03:00
|
|
|
:name => 'grit', :owner => { :login => 'mojombo' },
|
2015-04-28 10:11:55 +03:00
|
|
|
:permissions => { :push => false }
|
|
|
|
}
|
|
|
|
"""
|
2012-05-04 19:13:59 +04:00
|
|
|
When I successfully run `hub submodule add mojombo/grit vendor/grit`
|
|
|
|
Then the "vendor/grit" submodule url should be "git://github.com/mojombo/grit.git"
|
|
|
|
And the output should contain exactly:
|
|
|
|
"""
|
|
|
|
Adding existing repo at 'vendor/grit' to the index\n
|
|
|
|
"""
|
|
|
|
|
|
|
|
Scenario: Add private submodule
|
2015-04-28 10:11:55 +03:00
|
|
|
Given the GitHub API server:
|
|
|
|
"""
|
|
|
|
get('/repos/mojombo/grit') {
|
|
|
|
json :private => false,
|
2016-08-08 14:44:07 +03:00
|
|
|
:name => 'grit', :owner => { :login => 'mojombo' },
|
2015-04-28 10:11:55 +03:00
|
|
|
:permissions => { :push => false }
|
|
|
|
}
|
|
|
|
"""
|
2012-05-04 19:13:59 +04:00
|
|
|
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"
|
|
|
|
|
2014-12-25 07:20:28 +03:00
|
|
|
Scenario: A submodule for my own repo is public nevertheless
|
2015-04-28 10:11:55 +03:00
|
|
|
Given the GitHub API server:
|
|
|
|
"""
|
|
|
|
get('/repos/mislav/grit') {
|
|
|
|
json :private => false,
|
2016-08-08 14:44:07 +03:00
|
|
|
:name => 'grit', :owner => { :login => 'mislav' },
|
2015-04-28 10:11:55 +03:00
|
|
|
:permissions => { :push => true }
|
|
|
|
}
|
|
|
|
"""
|
2014-12-25 07:20:28 +03:00
|
|
|
When I successfully run `hub submodule add grit vendor/grit`
|
2015-04-28 10:11:55 +03:00
|
|
|
Then the "vendor/grit" submodule url should be "git://github.com/mislav/grit.git"
|
2014-12-25 07:20:28 +03:00
|
|
|
|
2012-05-04 19:13:59 +04:00
|
|
|
Scenario: Add submodule with arguments
|
2015-04-28 10:11:55 +03:00
|
|
|
Given the GitHub API server:
|
|
|
|
"""
|
|
|
|
get('/repos/mojombo/grit') {
|
|
|
|
json :private => false,
|
2016-08-08 14:44:07 +03:00
|
|
|
:name => 'grit', :owner => { :login => 'mojombo' },
|
2015-04-28 10:11:55 +03:00
|
|
|
:permissions => { :push => false }
|
|
|
|
}
|
|
|
|
"""
|
2013-01-19 22:57:57 +04:00
|
|
|
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
|
2013-01-20 19:26:37 +04:00
|
|
|
|
|
|
|
Scenario: Add submodule with branch
|
2015-04-28 10:11:55 +03:00
|
|
|
Given the GitHub API server:
|
|
|
|
"""
|
|
|
|
get('/repos/mojombo/grit') {
|
|
|
|
json :private => false,
|
2016-08-08 14:44:07 +03:00
|
|
|
:name => 'grit', :owner => { :login => 'mojombo' },
|
2015-04-28 10:11:55 +03:00
|
|
|
:permissions => { :push => false }
|
|
|
|
}
|
|
|
|
"""
|
2013-01-20 19:26:37 +04:00
|
|
|
When I successfully run `hub submodule add --branch foo mojombo/grit vendor/grit`
|
|
|
|
Then "git submodule add --branch foo git://github.com/mojombo/grit.git vendor/grit" should be run
|