From dabcc866e5ebf0e0ed120515c5e5ef727923d13c Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 23 Jun 2020 15:17:49 +0200 Subject: [PATCH] add another inspect test --- command/inspect_test.go | 12 ++++++++++++ command/test-fixtures/hcl/vars/fruit_string.pkr.hcl | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 command/test-fixtures/hcl/vars/fruit_string.pkr.hcl diff --git a/command/inspect_test.go b/command/inspect_test.go index 35575e2c9..27f8474da 100644 --- a/command/inspect_test.go +++ b/command/inspect_test.go @@ -37,6 +37,18 @@ local.fruit: "banana" +`}, + {[]string{"inspect", "-var=fruit=peach", filepath.Join(testFixture("hcl"), "vars", "fruit_string.pkr.hcl")}, nil, `Packer Inspect: HCL2 mode + +> input-variables: + +var.fruit: "peach" [debug: {Type:cty.String,CmdValue:peach,VarfileValue:null,EnvValue:null,DefaultValue:banana}] + +> local-variables: + + +> builds: + `}, } diff --git a/command/test-fixtures/hcl/vars/fruit_string.pkr.hcl b/command/test-fixtures/hcl/vars/fruit_string.pkr.hcl new file mode 100644 index 000000000..3140d12e0 --- /dev/null +++ b/command/test-fixtures/hcl/vars/fruit_string.pkr.hcl @@ -0,0 +1,5 @@ + +variable "fruit" { + type = string + default = "banana" +}