From ac444accb122e343ba6576f6e3e5c4dc038a8cec Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 30 Jun 2015 10:44:56 -0700 Subject: [PATCH] helper/config: tests --- helper/config/decode_test.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/helper/config/decode_test.go b/helper/config/decode_test.go index f9fa590c9..f325ae4a5 100644 --- a/helper/config/decode_test.go +++ b/helper/config/decode_test.go @@ -74,6 +74,36 @@ func TestDecode(t *testing.T) { }, }, }, + + "build name": { + []interface{}{ + map[string]interface{}{ + "name": "{{build_name}}", + }, + map[string]interface{}{ + "packer_build_name": "foo", + }, + }, + &Target{ + Name: "foo", + }, + nil, + }, + + "build type": { + []interface{}{ + map[string]interface{}{ + "name": "{{build_type}}", + }, + map[string]interface{}{ + "packer_builder_type": "foo", + }, + }, + &Target{ + Name: "foo", + }, + nil, + }, } for k, tc := range cases {