@@ -45,7 +45,8 @@ func TestEnvPriority(t *testing.T) {
45
45
cmd := c .NewDockerComposeCmd (t , "-f" , "./fixtures/environment/env-priority/compose-with-env.yaml" ,
46
46
"--project-directory" , projectDir , "--env-file" , "./fixtures/environment/env-priority/.env.override" , "run" ,
47
47
"--rm" , "-e" , "WHEREAMI" , "env-compose-priority" )
48
- res := icmd .RunCmd (cmd , icmd .WithEnv ("WHEREAMI=shell" ))
48
+ cmd .Env = append (cmd .Env , "WHEREAMI=shell" )
49
+ res := icmd .RunCmd (cmd )
49
50
assert .Equal (t , strings .TrimSpace (res .Stdout ()), "Compose File" )
50
51
})
51
52
@@ -59,7 +60,8 @@ func TestEnvPriority(t *testing.T) {
59
60
cmd := c .NewDockerComposeCmd (t , "-f" , "./fixtures/environment/env-priority/compose.yaml" , "--project-directory" ,
60
61
projectDir , "--env-file" , "./fixtures/environment/env-priority/.env.override" , "run" , "--rm" , "-e" ,
61
62
"WHEREAMI" , "env-compose-priority" )
62
- res := icmd .RunCmd (cmd , icmd .WithEnv ("WHEREAMI=shell" ))
63
+ cmd .Env = append (cmd .Env , "WHEREAMI=shell" )
64
+ res := icmd .RunCmd (cmd )
63
65
assert .Equal (t , strings .TrimSpace (res .Stdout ()), "shell" )
64
66
})
65
67
@@ -133,7 +135,8 @@ func TestEnvInterpolation(t *testing.T) {
133
135
t .Run ("shell priority from run command" , func (t * testing.T ) {
134
136
cmd := c .NewDockerComposeCmd (t , "-f" , "./fixtures/environment/env-interpolation/compose.yaml" ,
135
137
"--project-directory" , projectDir , "config" )
136
- res := icmd .RunCmd (cmd , icmd .WithEnv ("WHEREAMI=shell" ))
138
+ cmd .Env = append (cmd .Env , "WHEREAMI=shell" )
139
+ res := icmd .RunCmd (cmd )
137
140
res .Assert (t , icmd.Expected {Out : `IMAGE: default_env:shell` })
138
141
})
139
142
}
0 commit comments