-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
browse.feature
219 lines (185 loc) · 9.71 KB
/
browse.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
Feature: hub browse
Background:
Given I am "mislav" on github.com with OAuth token "OTOKEN"
Scenario: No repo
When I run `hub browse`
Then the exit status should be 1
Then the output should contain exactly "Usage: hub browse [-uc] [[<USER>/]<REPOSITORY>|--] [<SUBPAGE>]\n"
Scenario: Project with owner
When I successfully run `hub browse mislav/dotfiles`
Then the output should not contain anything
And "open https://github.com/mislav/dotfiles" should be run
Scenario: Project without owner
Given I am "mislav" on github.com
When I successfully run `hub browse dotfiles`
Then "open https://github.com/mislav/dotfiles" should be run
Scenario: Explicit project overrides current
Given I am in "git://github.com/josh/rails-behaviors.git" git repo
And I am "mislav" on github.com
When I successfully run `hub browse dotfiles`
Then "open https://github.com/mislav/dotfiles" should be run
Scenario: Project issues
When I successfully run `hub browse mislav/dotfiles issues`
Then "open https://github.com/mislav/dotfiles/issues" should be run
Scenario: Project wiki
When I successfully run `hub browse mislav/dotfiles wiki`
Then "open https://github.com/mislav/dotfiles/wiki" should be run
Scenario: Project commits on master
When I successfully run `hub browse mislav/dotfiles commits`
Then "open https://github.com/mislav/dotfiles/commits/master" should be run
Scenario: Specific commit in project
When I successfully run `hub browse mislav/dotfiles commit/4173c3b`
Then "open https://github.com/mislav/dotfiles/commit/4173c3b" should be run
Scenario: Output the URL instead of browse
When I successfully run `hub browse -u mislav/dotfiles`
Then the output should contain exactly "https://github.com/mislav/dotfiles\n"
But "open https://github.com/mislav/dotfiles" should not be run
Scenario: Current project
Given I am in "git://github.com/mislav/dotfiles.git" git repo
When I successfully run `hub browse`
Then the output should not contain anything
And "open https://github.com/mislav/dotfiles" should be run
Scenario: Commit in current project
Given I am in "git://github.com/mislav/dotfiles.git" git repo
When I successfully run `hub browse -- commit/abcd1234`
Then "open https://github.com/mislav/dotfiles/commit/abcd1234" should be run
Scenario: Current branch
Given I am in "git://github.com/mislav/dotfiles.git" git repo
And git "push.default" is set to "upstream"
And I am on the "feature" branch with upstream "origin/experimental"
When I successfully run `hub browse`
Then "open https://github.com/mislav/dotfiles/tree/experimental" should be run
Scenario: Current branch pushed to fork
Given I am in "git://github.com/blueyed/dotfiles.git" git repo
And the "mislav" remote has url "[email protected]:mislav/dotfiles.git"
And I am on the "feature" branch with upstream "mislav/experimental"
And git "push.default" is set to "upstream"
When I successfully run `hub browse`
Then "open https://github.com/mislav/dotfiles/tree/experimental" should be run
Scenario: Current branch pushed to fork with simple tracking
Given I am in "git://github.com/blueyed/dotfiles.git" git repo
And the "mislav" remote has url "[email protected]:mislav/dotfiles.git"
And I am on the "feature" branch with upstream "mislav/feature"
And git "push.default" is set to "simple"
When I successfully run `hub browse`
Then "open https://github.com/mislav/dotfiles/tree/feature" should be run
Scenario: Default branch
Given I am in "git://github.com/mislav/dotfiles.git" git repo
And the default branch for "origin" is "develop"
And I am on the "develop" branch with upstream "origin/develop"
When I successfully run `hub browse`
Then "open https://github.com/mislav/dotfiles" should be run
Scenario: Current branch, no tracking
Given I am in "git://github.com/mislav/dotfiles.git" git repo
And I am on the "feature" branch
When I successfully run `hub browse`
Then "open https://github.com/mislav/dotfiles" should be run
Scenario: Default branch in upstream repo as opposed to fork
Given I am in "git://github.com/jashkenas/coffee-script.git" git repo
And the "mislav" remote has url "[email protected]:mislav/coffee-script.git"
And the default branch for "origin" is "master"
And the "master" branch is pushed to "mislav/master"
When I successfully run `hub browse`
Then "open https://github.com/jashkenas/coffee-script" should be run
Scenario: Current branch with special chars
Given I am in "git://github.com/mislav/dotfiles.git" git repo
And I am on the "fix-bug-#123" branch with upstream "origin/fix-bug-#123"
When I successfully run `hub browse`
Then "open https://github.com/mislav/dotfiles/tree/fix-bug-%23123" should be run
Scenario: Commits on current branch
Given I am in "git://github.com/mislav/dotfiles.git" git repo
And git "push.default" is set to "upstream"
And I am on the "feature" branch with upstream "origin/experimental"
When I successfully run `hub browse -- commits`
Then "open https://github.com/mislav/dotfiles/commits/experimental" should be run
Scenario: Issues subpage ignores tracking configuration
Given I am in "git://github.com/jashkenas/coffee-script.git" git repo
And the "mislav" remote has url "[email protected]:mislav/coffee-script.git"
And git "push.default" is set to "upstream"
And I am on the "feature" branch with upstream "mislav/experimental"
When I successfully run `hub browse -- issues`
Then "open https://github.com/jashkenas/coffee-script/issues" should be run
Scenario: Issues subpage ignores current branch
Given I am in "git://github.com/jashkenas/coffee-script.git" git repo
And the "mislav" remote has url "[email protected]:mislav/coffee-script.git"
And I am on the "feature" branch pushed to "mislav/feature"
When I successfully run `hub browse -- issues`
Then the output should not contain anything
Then "open https://github.com/jashkenas/coffee-script/issues" should be run
Scenario: Forward Slash Delimited branch
Given I am in "git://github.com/mislav/dotfiles.git" git repo
And git "push.default" is set to "upstream"
And I am on the "foo/bar" branch with upstream "origin/baz/qux/moo"
When I successfully run `hub browse`
Then "open https://github.com/mislav/dotfiles/tree/baz/qux/moo" should be run
Scenario: No branch
Given I am in "git://github.com/mislav/dotfiles.git" git repo
And I am in detached HEAD
When I successfully run `hub browse`
Then "open https://github.com/mislav/dotfiles" should be run
Scenario: No branch to pulls
Given I am in "git://github.com/mislav/dotfiles.git" git repo
And I am in detached HEAD
When I successfully run `hub browse -- pulls`
Then "open https://github.com/mislav/dotfiles/pulls" should be run
Scenario: Dot Delimited branch
Given I am in "git://github.com/mislav/dotfiles.git" git repo
And git "push.default" is set to "upstream"
And I am on the "fix-glob-for.js" branch with upstream "origin/fix-glob-for.js"
When I successfully run `hub browse`
Then "open https://github.com/mislav/dotfiles/tree/fix-glob-for.js" should be run
Scenario: Wiki repo
Given I am in "git://github.com/defunkt/hub.wiki.git" git repo
When I successfully run `hub browse`
Then "open https://github.com/defunkt/hub/wiki" should be run
Scenario: Wiki commits
Given I am in "git://github.com/defunkt/hub.wiki.git" git repo
When I successfully run `hub browse -- commits`
Then "open https://github.com/defunkt/hub/wiki/_history" should be run
Scenario: Wiki pages
Given I am in "git://github.com/defunkt/hub.wiki.git" git repo
When I successfully run `hub browse -- pages`
Then "open https://github.com/defunkt/hub/wiki/_pages" should be run
Scenario: Repo with remote with local path
Given I am in "git://github.com/mislav/dotfiles.git" git repo
And the "upstream" remote has url "../path/to/another/repo.git"
When I successfully run `hub browse`
Then "open https://github.com/mislav/dotfiles" should be run
Scenario: Enterprise repo
Given I am in "git://git.my.org/mislav/dotfiles.git" git repo
And I am "mislav" on git.my.org with OAuth token "FITOKEN"
And "git.my.org" is a whitelisted Enterprise host
When I successfully run `hub browse`
Then "open https://git.my.org/mislav/dotfiles" should be run
Scenario: Multiple Enterprise repos
Given I am in "git://git.my.org/mislav/dotfiles.git" git repo
And I am "mislav" on git.my.org with OAuth token "FITOKEN"
And "git.my.org" is a whitelisted Enterprise host
And "git.another.org" is a whitelisted Enterprise host
When I successfully run `hub browse`
Then "open https://git.my.org/mislav/dotfiles" should be run
Scenario: Enterprise repo over HTTP
Given I am in "git://git.my.org/mislav/dotfiles.git" git repo
And I am "mislav" on http://git.my.org with OAuth token "FITOKEN"
And "git.my.org" is a whitelisted Enterprise host
When I successfully run `hub browse`
Then "open http://git.my.org/mislav/dotfiles" should be run
Scenario: SSH alias
Given the SSH config:
"""
Host gh
User git
HostName github.com
"""
Given I am in "gh:singingwolfboy/sekrit.git" git repo
When I successfully run `hub browse`
Then "open https://github.com/singingwolfboy/sekrit" should be run
Scenario: SSH GitHub alias
Given the SSH config:
"""
Host github.com
HostName ssh.github.com
"""
Given I am in "[email protected]:suan/git-sanity.git" git repo
When I successfully run `hub browse`
Then "open https://github.com/suan/git-sanity" should be run