@@ -10,7 +10,6 @@ import (
10
10
"testing"
11
11
"time"
12
12
13
- "github.com/d4l3k/messagediff"
14
13
"github.com/jetstack/preflight/pkg/client"
15
14
"github.com/kylelemons/godebug/diff"
16
15
"github.com/stretchr/testify/assert"
@@ -213,9 +212,7 @@ func TestValidConfigLoad(t *testing.T) {
213
212
`
214
213
215
214
loadedConfig , err := ParseConfig ([]byte (configFileContents ), false )
216
- if err != nil {
217
- t .Fatalf ("unexpected error: %v" , err )
218
- }
215
+ assert .NoError (t , err )
219
216
220
217
expected := Config {
221
218
Server : "http://localhost:8080" ,
@@ -235,9 +232,7 @@ func TestValidConfigLoad(t *testing.T) {
235
232
OutputPath : "/nothome" ,
236
233
}
237
234
238
- if diff , equal := messagediff .PrettyDiff (expected , loadedConfig ); ! equal {
239
- t .Errorf ("Diff %s" , diff )
240
- }
235
+ assert .Equal (t , expected , loadedConfig )
241
236
}
242
237
243
238
func TestValidConfigWithEndpointLoad (t * testing.T ) {
@@ -256,9 +251,7 @@ func TestValidConfigWithEndpointLoad(t *testing.T) {
256
251
`
257
252
258
253
loadedConfig , err := ParseConfig ([]byte (configFileContents ), false )
259
- if err != nil {
260
- t .Errorf ("unexpected error: %v" , err )
261
- }
254
+ assert .NoError (t , err )
262
255
263
256
expected := Config {
264
257
Endpoint : Endpoint {
@@ -280,9 +273,7 @@ func TestValidConfigWithEndpointLoad(t *testing.T) {
280
273
},
281
274
}
282
275
283
- if diff , equal := messagediff .PrettyDiff (expected , loadedConfig ); ! equal {
284
- t .Errorf ("Diff %s" , diff )
285
- }
276
+ assert .Equal (t , expected , loadedConfig )
286
277
}
287
278
288
279
func TestValidVenafiCloudConfigLoad (t * testing.T ) {
@@ -302,9 +293,7 @@ func TestValidVenafiCloudConfigLoad(t *testing.T) {
302
293
`
303
294
304
295
loadedConfig , err := ParseConfig ([]byte (configFileContents ), false )
305
- if err != nil {
306
- t .Fatalf ("unexpected error: %v" , err )
307
- }
296
+ assert .NoError (t , err )
308
297
309
298
expected := Config {
310
299
Server : "http://localhost:8080" ,
@@ -328,9 +317,7 @@ func TestValidVenafiCloudConfigLoad(t *testing.T) {
328
317
},
329
318
}
330
319
331
- if diff , equal := messagediff .PrettyDiff (expected , loadedConfig ); ! equal {
332
- t .Errorf ("Diff %s" , diff )
333
- }
320
+ assert .Equal (t , expected , loadedConfig )
334
321
}
335
322
336
323
func TestInvalidConfigError (t * testing.T ) {
0 commit comments