@@ -27,12 +27,14 @@ func TestFromEnvVars(t *testing.T) {
27
27
UsersFile : "/default/user/path" ,
28
28
RedirectURIs : []string {"re" , "direct" , "uris" },
29
29
Issuer : "123" ,
30
+ DevMode : true ,
30
31
},
31
32
want : & Config {
32
33
Port : "6666" ,
33
34
UsersFile : "/default/user/path" ,
34
35
RedirectURIs : []string {"re" , "direct" , "uris" },
35
36
Issuer : "123" ,
37
+ DevMode : true ,
36
38
},
37
39
},
38
40
{
@@ -42,18 +44,21 @@ func TestFromEnvVars(t *testing.T) {
42
44
"USERS_FILE" : "/path/to/users" ,
43
45
"REDIRECT_URIS" : "http://redirect/redirect" ,
44
46
"ISSUER" : "someissuer" ,
47
+ "DEV_MODE" : "true" ,
45
48
},
46
49
defaults : & Config {
47
50
Port : "6666" ,
48
51
UsersFile : "/default/user/path" ,
49
52
RedirectURIs : []string {"re" , "direct" , "uris" },
50
53
Issuer : "someissuer" ,
54
+ DevMode : false ,
51
55
},
52
56
want : & Config {
53
57
Port : "1234" ,
54
58
UsersFile : "/path/to/users" ,
55
59
RedirectURIs : []string {"http://redirect/redirect" },
56
60
Issuer : "someissuer" ,
61
+ DevMode : true ,
57
62
},
58
63
},
59
64
{
@@ -75,7 +80,7 @@ func TestFromEnvVars(t *testing.T) {
75
80
}
76
81
cfg := FromEnvVars (tc .defaults )
77
82
if fmt .Sprint (cfg ) != fmt .Sprint (tc .want ) {
78
- t .Errorf ("Expected FromEnvVars()=%q , but got %q " , tc .want , cfg )
83
+ t .Errorf ("Expected FromEnvVars()=%v , but got %v " , tc .want , cfg )
79
84
}
80
85
})
81
86
}
0 commit comments