@@ -177,21 +177,17 @@ func Test_validateConfig(t *testing.T) {
177
177
errorMessage string
178
178
}{
179
179
{
180
- name : "Missing fromRef and newTag" ,
180
+ name : "Missing fromRef or newTag when branch is set only " ,
181
181
args : & notesCmdConfig {
182
182
branch : "main" ,
183
- fromRef : "" ,
184
- newTag : "" ,
185
183
},
186
184
wantErr : true ,
187
185
errorMessage : "at least one of --from or --release need to be set" ,
188
186
},
189
187
{
190
- name : "Missing branch and newTag" ,
188
+ name : "Missing branch or newTag when fromRef is set only " ,
191
189
args : & notesCmdConfig {
192
190
fromRef : "ref1/tags" ,
193
- branch : "" ,
194
- newTag : "" ,
195
191
},
196
192
wantErr : true ,
197
193
errorMessage : "at least one of --branch or --release need to be set" ,
@@ -247,7 +243,7 @@ func Test_computeConfigDefaults(t *testing.T) {
247
243
wantErr bool
248
244
}{
249
245
{
250
- name : "New minor release, fromRef missing " ,
246
+ name : "Calculate fromRef when newTag is a new minor release and toRef " ,
251
247
args : & notesCmdConfig {
252
248
branch : "develop" ,
253
249
newTag : "v1.1.0" ,
@@ -261,7 +257,7 @@ func Test_computeConfigDefaults(t *testing.T) {
261
257
wantErr : false ,
262
258
},
263
259
{
264
- name : "New patch release, fromRef missing " ,
260
+ name : "Calculate fromRef when newTag is not a new minor release, branch and toRef " ,
265
261
args : & notesCmdConfig {
266
262
newTag : "v1.1.3" ,
267
263
},
@@ -274,7 +270,7 @@ func Test_computeConfigDefaults(t *testing.T) {
274
270
wantErr : false ,
275
271
},
276
272
{
277
- name : "Invalid semver" ,
273
+ name : "Fail when newTag is not a valid semver" ,
278
274
args : & notesCmdConfig {
279
275
newTag : "invalid-tag" ,
280
276
},
0 commit comments