From 0eb3cfd261d7fe6fe22a0d8d2768a5270c226604 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 23 Sep 2020 13:23:59 +0200 Subject: [PATCH] Add test-case for env with, and without = Signed-off-by: Sebastiaan van Stijn --- cli/command/image/import_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cli/command/image/import_test.go b/cli/command/image/import_test.go index 94e7d723aa..f2664f1275 100644 --- a/cli/command/image/import_test.go +++ b/cli/command/image/import_test.go @@ -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]))