@@ -13,29 +13,26 @@ spec =
13
13
context " when the required envs are defined" $
14
14
it " should succeed the type check" $
15
15
let schemeEnvs =
16
- Config
17
- [ EnvConf EnvBool [Env " FOO" True ]
18
- , EnvConf EnvInteger [Env " BAR" False ]
16
+ [ Env " FOO" EnvBool True
17
+ , Env " BAR" EnvInteger False
19
18
]
20
19
dotenvs = [(" FOO" ," true" ), (" BAR" ," 123" )]
21
20
in checkConfig dotenvs schemeEnvs `shouldReturn` ()
22
21
23
22
context " when the not required envs are missing" $
24
23
it " should succeed the type check" $
25
24
let schemeEnvs =
26
- Config
27
- [ EnvConf EnvBool [Env " FOO" True ]
28
- , EnvConf EnvInteger [Env " BAR" False ]
25
+ [ Env " FOO" EnvBool True
26
+ , Env " BAR" EnvInteger False
29
27
]
30
28
dotenvs = [(" FOO" ," true" )]
31
29
in checkConfig dotenvs schemeEnvs `shouldReturn` ()
32
30
33
31
context " when the required envs are missing" $
34
32
it " should fail before the type check" $
35
33
let schemeEnvs =
36
- Config
37
- [ EnvConf EnvBool [Env " FOO" True ]
38
- , EnvConf EnvInteger [Env " BAR" False ]
34
+ [ Env " FOO" EnvBool True
35
+ , Env " BAR" EnvInteger False
39
36
]
40
37
dotenvs = [(" BAR" ," 123" )]
41
38
msg = " The following envs: FOO must be in the dotenvs"
44
41
context " when there are missing dotenvs in the scheme" $
45
42
it " should fail before type checking" $
46
43
let schemeEnvs =
47
- Config
48
- [ EnvConf EnvBool [Env " FOO" True ]
49
- , EnvConf EnvInteger [Env " BAR" False ]
44
+ [ Env " FOO" EnvBool True
45
+ , Env " BAR" EnvInteger False
50
46
]
51
47
dotenvs = [(" FOO" ," true" ), (" BAR" ," 123" ), (" BAZ" ," text" )]
52
48
msg = " The following envs: BAZ must be in your scheme.yml"
@@ -55,10 +51,9 @@ spec =
55
51
context " when there are missing scheme envs in the dotenv vars" $
56
52
it " should fail before type checking" $
57
53
let schemeEnvs =
58
- Config
59
- [ EnvConf EnvBool [Env " FOO" True ]
60
- , EnvConf EnvText [Env " BAZ" True ]
61
- , EnvConf EnvInteger [Env " BAR" False ]
54
+ [ Env " FOO" EnvBool True
55
+ , Env " BAZ" EnvText True
56
+ , Env " BAR" EnvInteger False
62
57
]
63
58
dotenvs = [(" FOO" ," true" ), (" BAR" ," 123" )]
64
59
msg = " The following envs: BAZ must be in the dotenvs"
0 commit comments