Add test-case for env with, and without =

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0eb3cfd261)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-09-23 13:23:59 +02:00
parent f526bcdb53
commit 278f30b82b
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 8 additions and 0 deletions

View File

@ -81,6 +81,14 @@ func TestNewImportCommandSuccess(t *testing.T) {
},
{
name: "change",
args: []string{"--change", "ENV DEBUG=true", "-"},
imageImportFunc: func(source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) {
assert.Check(t, is.Equal("ENV DEBUG=true", options.Changes[0]))
return ioutil.NopCloser(strings.NewReader("")), nil
},
},
{
name: "change legacy syntax",
args: []string{"--change", "ENV DEBUG true", "-"},
imageImportFunc: func(source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) {
assert.Check(t, is.Equal("ENV DEBUG true", options.Changes[0]))