forked from mislav/hub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubmodule_add.feature
65 lines (60 loc) · 2.27 KB
/
submodule_add.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Feature: hub submodule add
Background:
Given I am "mislav" on github.com with OAuth token "OTOKEN"
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"
Scenario: Add public submodule
Given the GitHub API server:
"""
get('/repos/mojombo/grit') {
json :private => false,
:permissions => { :push => false }
}
"""
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
Given the GitHub API server:
"""
get('/repos/mojombo/grit') {
json :private => false,
:permissions => { :push => false }
}
"""
When I successfully run `hub submodule add -p mojombo/grit vendor/grit`
Then the "vendor/grit" submodule url should be "[email protected]:mojombo/grit.git"
Scenario: A submodule for my own repo is public nevertheless
Given the GitHub API server:
"""
get('/repos/mislav/grit') {
json :private => false,
:permissions => { :push => true }
}
"""
When I successfully run `hub submodule add grit vendor/grit`
Then the "vendor/grit" submodule url should be "git://github.com/mislav/grit.git"
Scenario: Add submodule with arguments
Given the GitHub API server:
"""
get('/repos/mojombo/grit') {
json :private => false,
:permissions => { :push => false }
}
"""
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
Scenario: Add submodule with branch
Given the GitHub API server:
"""
get('/repos/mojombo/grit') {
json :private => false,
:permissions => { :push => false }
}
"""
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