1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #33557 from AkihiroSuda/test-no-unset

builder: add a test for `ENV name` (without `=value`)
This commit is contained in:
Vincent Demeester 2017-06-07 17:51:42 +02:00 committed by GitHub
commit d2c6e78371

View file

@ -64,3 +64,11 @@ func TestNodeFromLabels(t *testing.T) {
assert.Equal(t, expected, node)
}
func TestParseNameValWithoutVal(t *testing.T) {
directive := Directive{}
// In Config.Env, a variable without `=` is removed from the environment. (#31634)
// However, in Dockerfile, we don't allow "unsetting" an environment variable. (#11922)
_, err := parseNameVal("foo", "ENV", &directive)
assert.Error(t, err, "ENV must have two arguments")
}