/
remote_add.feature
118 lines (97 loc) · 4.98 KB
/
remote_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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Feature: hub remote add
Background:
Given I am "EvilChelu" on GitHub.com
And I am in "dotfiles" git repo
Scenario: Add origin remote for my own repo
Given there are no remotes
When I successfully run `hub remote add origin`
Then the url for "origin" should be "git@github.com:EvilChelu/dotfiles.git"
And there should be no output
Scenario: Add origin remote for my own repo using -C
Given there are no remotes
And I cd to ".."
When I successfully run `hub -C dotfiles remote add origin`
And I cd to "dotfiles"
Then the url for "origin" should be "git@github.com:EvilChelu/dotfiles.git"
And there should be no output
Scenario: Unchanged public remote add
When I successfully run `hub remote add origin http://github.com/defunkt/resque.git`
Then the url for "origin" should be "http://github.com/defunkt/resque.git"
And there should be no output
Scenario: Unchanged private remote add
When I successfully run `hub remote add origin git@github.com:defunkt/resque.git`
Then the url for "origin" should be "git@github.com:defunkt/resque.git"
And there should be no output
Scenario: Unchanged local path remote add
When I successfully run `hub remote add myremote ./path`
Then the git command should be unchanged
And there should be no output
Scenario: Unchanged local absolute path remote add
When I successfully run `hub remote add myremote /path`
Then the git command should be unchanged
And there should be no output
Scenario: Unchanged remote add with host alias
When I successfully run `hub remote add myremote server:/git/repo.git`
Then the git command should be unchanged
And there should be no output
Scenario: Add new remote for Enterprise repo
Given "git.my.org" is a whitelisted Enterprise host
And I am "ProLoser" on git.my.org with OAuth token "FITOKEN"
And the "origin" remote has url "git@git.my.org:mislav/topsekrit.git"
When I successfully run `hub remote add another`
Then the url for "another" should be "git@git.my.org:another/topsekrit.git"
And there should be no output
Scenario: Add public remote
When I successfully run `hub remote add mislav`
Then the url for "mislav" should be "git://github.com/mislav/dotfiles.git"
And there should be no output
Scenario: Add private remote
When I successfully run `hub remote add -p mislav`
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
And there should be no output
Scenario: Add HTTPS protocol remote
Given HTTPS is preferred
When I successfully run `hub remote add mislav`
Then the url for "mislav" should be "https://github.com/mislav/dotfiles.git"
And there should be no output
Scenario: Add named public remote
When I successfully run `hub remote add mm mislav`
Then the url for "mm" should be "git://github.com/mislav/dotfiles.git"
And there should be no output
Scenario: set-url
Given the "origin" remote has url "git://github.com/evilchelu/dotfiles.git"
When I successfully run `hub remote set-url origin mislav`
Then the url for "origin" should be "git://github.com/mislav/dotfiles.git"
And there should be no output
Scenario: Add public remote including repo name
When I successfully run `hub remote add mislav/dotfilez.js`
Then the url for "mislav" should be "git://github.com/mislav/dotfilez.js.git"
And there should be no output
Scenario: Add named public remote including repo name
When I successfully run `hub remote add 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
When I successfully run `hub remote add -p mm mislav`
Then the url for "mm" should be "git@github.com:mislav/dotfiles.git"
And there should be no output
Scenario: Add private remote including repo name
When I successfully run `hub remote add -p mislav/dotfilez.js`
Then the url for "mislav" should be "git@github.com:mislav/dotfilez.js.git"
And there should be no output
Scenario: Add named private remote including repo name
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