Commit dee1bc6c authored by Julian Phillips's avatar Julian Phillips

packer/template: Test that builder.rawConfig excludes name

The name isn't actually part of the builder config, so it should be
removed during parsing.
parent f415fc18
......@@ -128,6 +128,19 @@ func TestParseTemplate_BuilderWithName(t *testing.T) {
builder, ok := result.Builders["bob"]
assert.True(ok, "should have bob builder")
assert.Equal(builder.Type, "amazon-ebs", "builder should be amazon-ebs")
rawConfig := builder.rawConfig
if rawConfig == nil {
t.Fatal("missing builder raw config")
}
expected := map[string]interface{}{
"type": "amazon-ebs",
}
if !reflect.DeepEqual(rawConfig, expected) {
t.Fatalf("bad raw: %#v", rawConfig)
}
}
func TestParseTemplate_BuilderWithConflictingName(t *testing.T) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment