helper/diff: fix problems with PreProcess

This commit is contained in:
Mitchell Hashimoto 2014-07-16 16:40:54 -07:00
parent 2cfad3fa71
commit c89e02c545
2 changed files with 4 additions and 4 deletions

View File

@ -96,7 +96,7 @@ func (b *ResourceBuilder) Diff(
// If we have a pre-processor for this, run it.
if pp, ok := b.PreProcess[k]; ok {
v = pp(k)
v = pp(v)
}
}

View File

@ -206,8 +206,8 @@ func TestResourceBuilder_preProcess(t *testing.T) {
},
PreProcess: map[string]PreProcessFunc{
"foo": func(string) string {
return "bar"
"foo": func(v string) string {
return "bar" + v
},
},
}
@ -413,7 +413,7 @@ const testRBNewDiff = `UPDATE
`
const testRBPreProcessDiff = `CREATE
IN foo: "" => "bar" (forces new resource)
IN foo: "" => "barfoo" (forces new resource)
`
const testRBPreProcessUnknownDiff = `CREATE