packer: Add failing test for [GH-181] to fix

This commit is contained in:
Mitchell Hashimoto 2013-07-15 09:21:19 +09:00
parent 6b6beae3b8
commit c51ecbbc43
1 changed files with 17 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package packer
import (
"cgl.tideland.biz/asserts"
"sort"
"reflect"
"testing"
)
@ -556,7 +557,22 @@ func TestTemplate_Build_ProvisionerOverride(t *testing.T) {
`
template, err := ParseTemplate([]byte(data))
assert.Nil(err, "should not error")
if err != nil {
t.Fatalf("err: %s", err)
}
rawConfig := template.Provisioners[0].rawConfig
if rawConfig == nil {
t.Fatal("missing provisioner raw config")
}
expected := map[string]interface{}{
"type": "test-prov",
}
if !reflect.DeepEqual(rawConfig, expected) {
t.Fatalf("bad raw: %#v", rawConfig)
}
builder := testBuilder()
builderMap := map[string]Builder{