3
3
load ' util/init.sh'
4
4
5
5
@test " fails when no packages are specified" {
6
- test_util.mock_command do-plumbing-clone
7
- test_util.mock_command do-plumbing-add-deps
8
- test_util.mock_command do-plumbing-link-bins
9
- test_util.mock_command do-plumbing-link-completions
10
- test_util.mock_command do-plumbing-link-man
6
+ test_util.stub_command do-plumbing-clone
7
+ test_util.stub_command do-plumbing-add-deps
8
+ test_util.stub_command do-plumbing-link-bins
9
+ test_util.stub_command do-plumbing-link-completions
10
+ test_util.stub_command do-plumbing-link-man
11
11
12
12
run do-add
13
13
@@ -16,11 +16,11 @@ load 'util/init.sh'
16
16
}
17
17
18
18
@test " fails when the remote repository is owned by a user with username 'local'" {
19
- test_util.mock_command do-plumbing-clone
20
- test_util.mock_command do-plumbing-add-deps
21
- test_util.mock_command do-plumbing-link-bins
22
- test_util.mock_command do-plumbing-link-completions
23
- test_util.mock_command do-plumbing-link-man
19
+ test_util.stub_command do-plumbing-clone
20
+ test_util.stub_command do-plumbing-add-deps
21
+ test_util.stub_command do-plumbing-link-bins
22
+ test_util.stub_command do-plumbing-link-completions
23
+ test_util.stub_command do-plumbing-link-man
24
24
25
25
run do-add ' local/pkg'
26
26
@@ -32,11 +32,11 @@ load 'util/init.sh'
32
32
local site=' github.com'
33
33
local pkg=' username/main'
34
34
35
- test_util.mock_command do-plumbing-clone
36
- test_util.mock_command do-plumbing-add-deps
37
- test_util.mock_command do-plumbing-link-bins
38
- test_util.mock_command do-plumbing-link-completions
39
- test_util.mock_command do-plumbing-link-man
35
+ test_util.stub_command do-plumbing-clone
36
+ test_util.stub_command do-plumbing-add-deps
37
+ test_util.stub_command do-plumbing-link-bins
38
+ test_util.stub_command do-plumbing-link-completions
39
+ test_util.stub_command do-plumbing-link-man
40
40
41
41
test_util.create_package " $pkg "
42
42
run do-add " $BPM_ORIGIN_DIR /$site /$pkg "
@@ -46,11 +46,11 @@ load 'util/init.sh'
46
46
}
47
47
48
48
@test " executes install steps in right order" {
49
- test_util.mock_command do-plumbing-clone
50
- test_util.mock_command do-plumbing-add-deps
51
- test_util.mock_command do-plumbing-link-bins
52
- test_util.mock_command do-plumbing-link-completions
53
- test_util.mock_command do-plumbing-link-man
49
+ test_util.stub_command do-plumbing-clone
50
+ test_util.stub_command do-plumbing-add-deps
51
+ test_util.stub_command do-plumbing-link-bins
52
+ test_util.stub_command do-plumbing-link-completions
53
+ test_util.stub_command do-plumbing-link-man
54
54
55
55
run do-add username/package
56
56
@@ -64,11 +64,11 @@ load 'util/init.sh'
64
64
}
65
65
66
66
@test " executes install steps in right order for multiple packages" {
67
- test_util.mock_command do-plumbing-clone
68
- test_util.mock_command do-plumbing-add-deps
69
- test_util.mock_command do-plumbing-link-bins
70
- test_util.mock_command do-plumbing-link-completions
71
- test_util.mock_command do-plumbing-link-man
67
+ test_util.stub_command do-plumbing-clone
68
+ test_util.stub_command do-plumbing-add-deps
69
+ test_util.stub_command do-plumbing-link-bins
70
+ test_util.stub_command do-plumbing-link-completions
71
+ test_util.stub_command do-plumbing-link-man
72
72
73
73
run do-add username/package username2/package2
74
74
@@ -89,11 +89,11 @@ load 'util/init.sh'
89
89
90
90
91
91
@test " uses longhand (https) site to clone from, if specified" {
92
- test_util.mock_command do-plumbing-clone
93
- test_util.mock_command do-plumbing-add-deps
94
- test_util.mock_command do-plumbing-link-bins
95
- test_util.mock_command do-plumbing-link-completions
96
- test_util.mock_command do-plumbing-link-man
92
+ test_util.stub_command do-plumbing-clone
93
+ test_util.stub_command do-plumbing-add-deps
94
+ test_util.stub_command do-plumbing-link-bins
95
+ test_util.stub_command do-plumbing-link-completions
96
+ test_util.stub_command do-plumbing-link-man
97
97
98
98
run do-add https://gitlab.com/username/package
99
99
@@ -102,11 +102,11 @@ load 'util/init.sh'
102
102
}
103
103
104
104
@test " uses longhand (http) site to clone from, if specified" {
105
- test_util.mock_command do-plumbing-clone
106
- test_util.mock_command do-plumbing-add-deps
107
- test_util.mock_command do-plumbing-link-bins
108
- test_util.mock_command do-plumbing-link-completions
109
- test_util.mock_command do-plumbing-link-man
105
+ test_util.stub_command do-plumbing-clone
106
+ test_util.stub_command do-plumbing-add-deps
107
+ test_util.stub_command do-plumbing-link-bins
108
+ test_util.stub_command do-plumbing-link-completions
109
+ test_util.stub_command do-plumbing-link-man
110
110
111
111
run do-add http://gitlab.com/username/package
112
112
@@ -115,11 +115,11 @@ load 'util/init.sh'
115
115
}
116
116
117
117
@test " uses shorthand site to clone from, if specified" {
118
- test_util.mock_command do-plumbing-clone
119
- test_util.mock_command do-plumbing-add-deps
120
- test_util.mock_command do-plumbing-link-bins
121
- test_util.mock_command do-plumbing-link-completions
122
- test_util.mock_command do-plumbing-link-man
118
+ test_util.stub_command do-plumbing-clone
119
+ test_util.stub_command do-plumbing-add-deps
120
+ test_util.stub_command do-plumbing-link-bins
121
+ test_util.stub_command do-plumbing-link-completions
122
+ test_util.stub_command do-plumbing-link-man
123
123
124
124
run do-add site/username/package
125
125
@@ -128,11 +128,11 @@ load 'util/init.sh'
128
128
}
129
129
130
130
@test " uses GitHub as default site, if not specified" {
131
- test_util.mock_command do-plumbing-clone
132
- test_util.mock_command do-plumbing-add-deps
133
- test_util.mock_command do-plumbing-link-bins
134
- test_util.mock_command do-plumbing-link-completions
135
- test_util.mock_command do-plumbing-link-man
131
+ test_util.stub_command do-plumbing-clone
132
+ test_util.stub_command do-plumbing-add-deps
133
+ test_util.stub_command do-plumbing-link-bins
134
+ test_util.stub_command do-plumbing-link-completions
135
+ test_util.stub_command do-plumbing-link-man
136
136
137
137
run do-add username/package
138
138
@@ -141,11 +141,11 @@ load 'util/init.sh'
141
141
}
142
142
143
143
@test " uses ssh protocol, when specified" {
144
- test_util.mock_command do-plumbing-clone
145
- test_util.mock_command do-plumbing-add-deps
146
- test_util.mock_command do-plumbing-link-bins
147
- test_util.mock_command do-plumbing-link-completions
148
- test_util.mock_command do-plumbing-link-man
144
+ test_util.stub_command do-plumbing-clone
145
+ test_util.stub_command do-plumbing-add-deps
146
+ test_util.stub_command do-plumbing-link-bins
147
+ test_util.stub_command do-plumbing-link-completions
148
+ test_util.stub_command do-plumbing-link-man
149
149
150
150
run do-add --ssh username/package
151
151
@@ -154,11 +154,11 @@ load 'util/init.sh'
154
154
}
155
155
156
156
@test " uses ssh protocol, when specified (at end)" {
157
- test_util.mock_command do-plumbing-clone
158
- test_util.mock_command do-plumbing-add-deps
159
- test_util.mock_command do-plumbing-link-bins
160
- test_util.mock_command do-plumbing-link-completions
161
- test_util.mock_command do-plumbing-link-man
157
+ test_util.stub_command do-plumbing-clone
158
+ test_util.stub_command do-plumbing-add-deps
159
+ test_util.stub_command do-plumbing-link-bins
160
+ test_util.stub_command do-plumbing-link-completions
161
+ test_util.stub_command do-plumbing-link-man
162
162
163
163
run do-add username/package --ssh
164
164
@@ -167,11 +167,11 @@ load 'util/init.sh'
167
167
}
168
168
169
169
@test " uses ssh protocol raw, when specified" {
170
- test_util.mock_command do-plumbing-clone
171
- test_util.mock_command do-plumbing-add-deps
172
- test_util.mock_command do-plumbing-link-bins
173
- test_util.mock_command do-plumbing-link-completions
174
- test_util.mock_command do-plumbing-link-man
170
+ test_util.stub_command do-plumbing-clone
171
+ test_util.stub_command do-plumbing-add-deps
172
+ test_util.stub_command do-plumbing-link-bins
173
+ test_util.stub_command do-plumbing-link-completions
174
+ test_util.stub_command do-plumbing-link-man
175
175
176
176
run do-add git@github.com:username/package
177
177
@@ -180,11 +180,11 @@ load 'util/init.sh'
180
180
}
181
181
182
182
@test " uses custom version, when specified" {
183
- test_util.mock_command do-plumbing-clone
184
- test_util.mock_command do-plumbing-add-deps
185
- test_util.mock_command do-plumbing-link-bins
186
- test_util.mock_command do-plumbing-link-completions
187
- test_util.mock_command do-plumbing-link-man
183
+ test_util.stub_command do-plumbing-clone
184
+ test_util.stub_command do-plumbing-add-deps
185
+ test_util.stub_command do-plumbing-link-bins
186
+ test_util.stub_command do-plumbing-link-completions
187
+ test_util.stub_command do-plumbing-link-man
188
188
189
189
run do-add username/package@v1.2.3
190
190
@@ -193,17 +193,14 @@ load 'util/init.sh'
193
193
}
194
194
195
195
@test " does not use custom version, when not specified" {
196
- test_util.mock_command do-plumbing-clone
197
- test_util.mock_command do-plumbing-add-deps
198
- test_util.mock_command do-plumbing-link-bins
199
- test_util.mock_command do-plumbing-link-completions
200
- test_util.mock_command do-plumbing-link-man
196
+ test_util.stub_command do-plumbing-clone
197
+ test_util.stub_command do-plumbing-add-deps
198
+ test_util.stub_command do-plumbing-link-bins
199
+ test_util.stub_command do-plumbing-link-completions
200
+ test_util.stub_command do-plumbing-link-man
201
201
202
202
run do-add username/package@
203
203
204
204
assert_success
205
205
assert_line " do-plumbing-clone https://github.com/username/package.git github.com/username/package"
206
206
}
207
-
208
-
209
-
0 commit comments