@@ -471,6 +471,7 @@ func TestReadInConfig(t *testing.T) {
471
471
}
472
472
473
473
func TestDefault (t * testing.T ) {
474
+ Reset ()
474
475
SetDefault ("age" , 45 )
475
476
assert .Equal (t , 45 , Get ("age" ))
476
477
@@ -485,6 +486,7 @@ func TestDefault(t *testing.T) {
485
486
}
486
487
487
488
func TestUnmarshaling (t * testing.T ) {
489
+ Reset ()
488
490
SetConfigType ("yaml" )
489
491
r := bytes .NewReader (yamlExample )
490
492
@@ -521,13 +523,16 @@ func TestDefaultPost(t *testing.T) {
521
523
}
522
524
523
525
func TestAliases (t * testing.T ) {
526
+ initConfigs ()
527
+ Set ("age" , 40 )
524
528
RegisterAlias ("years" , "age" )
525
529
assert .Equal (t , 40 , Get ("years" ))
526
530
Set ("years" , 45 )
527
531
assert .Equal (t , 45 , Get ("age" ))
528
532
}
529
533
530
534
func TestAliasInConfigFile (t * testing.T ) {
535
+ initConfigs ()
531
536
// the config file specifies "beard". If we make this an alias for
532
537
// "hasbeard", we still want the old config file to work with beard.
533
538
RegisterAlias ("beard" , "hasbeard" )
@@ -870,6 +875,7 @@ func TestRecursiveAliases(t *testing.T) {
870
875
}
871
876
872
877
func TestUnmarshal (t * testing.T ) {
878
+ Reset ()
873
879
SetDefault ("port" , 1313 )
874
880
Set ("name" , "Steve" )
875
881
Set ("duration" , "1s1ms" )
@@ -1341,6 +1347,7 @@ func TestBindPFlagStringToInt(t *testing.T) {
1341
1347
}
1342
1348
1343
1349
func TestBoundCaseSensitivity (t * testing.T ) {
1350
+ initConfigs ()
1344
1351
assert .Equal (t , "brown" , Get ("eyes" ))
1345
1352
1346
1353
BindEnv ("eYEs" , "TURTLE_EYES" )
0 commit comments