From ad7c2593abab5d2b6f2f8903ae6a274f8bd0e4d3 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Wed, 5 Aug 2020 13:44:21 -0400 Subject: [PATCH] Initial work --- command/inspect_test.go | 22 ++++++++++++++++++- .../test-fixtures/var-arg/fruit_builder.json | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/command/inspect_test.go b/command/inspect_test.go index 2b31cedcf..c46a20b28 100644 --- a/command/inspect_test.go +++ b/command/inspect_test.go @@ -94,6 +94,26 @@ Use it at will. manifest shell-local +`}, + {[]string{"inspect", "-var=fruit=peach", filepath.Join(testFixture("var-arg"), "fruit_builder.json")}, nil, `Packer Inspect: JSON mode +Required variables: + + fruit + +Optional variables and their defaults: + + +Builders: + + null + +Provisioners: + + + +Note: If your build names contain user variables or template +functions such as 'timestamp', these are processed at build time, +and therefore only show in their raw form here. `}, } @@ -107,7 +127,7 @@ Use it at will. } actual := string(bs) if diff := cmp.Diff(tc.expected, actual); diff != "" { - t.Fatalf("unexpected ouput %s", diff) + t.Fatalf("unexpected output %s", diff) } }) } diff --git a/command/test-fixtures/var-arg/fruit_builder.json b/command/test-fixtures/var-arg/fruit_builder.json index abda09077..9d6831c8b 100644 --- a/command/test-fixtures/var-arg/fruit_builder.json +++ b/command/test-fixtures/var-arg/fruit_builder.json @@ -1,6 +1,6 @@ { "variables": { - "fruit": "" + "fruit": null }, "builders": [ {