compose: test env_file

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-01-06 11:42:16 +01:00
parent f04c8c8430
commit 3400fa5628
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

View File

@ -280,6 +280,27 @@ services:
require.Equal(t, c.Targets[1].NoCache, newBool(true))
}
func TestEnvFile(t *testing.T) {
envf, err := os.CreateTemp("", "env")
require.NoError(t, err)
defer os.Remove(envf.Name())
_, err = envf.WriteString("FOO=bsdf -csdf\n")
require.NoError(t, err)
var dt = []byte(`
services:
scratch:
build:
context: .
env_file:
- ` + envf.Name() + `
`)
_, err = ParseCompose(dt)
require.NoError(t, err)
}
func newBool(val bool) *bool {
b := val
return &b