terraform: failing test case

This commit is contained in:
Mitchell Hashimoto 2016-01-19 12:37:55 -08:00
parent 7ab19c62e6
commit 54de9057ba
3 changed files with 38 additions and 0 deletions

View File

@ -104,6 +104,29 @@ func TestContext2Plan_emptyDiff(t *testing.T) {
}
}
func TestContext2Plan_escapedVar(t *testing.T) {
m := testModule(t, "plan-escaped-var")
p := testProvider("aws")
p.DiffFn = testDiffFn
ctx := testContext2(t, &ContextOpts{
Module: m,
Providers: map[string]ResourceProviderFactory{
"aws": testProviderFuncFixed(p),
},
})
plan, err := ctx.Plan()
if err != nil {
t.Fatalf("err: %s", err)
}
actual := strings.TrimSpace(plan.String())
expected := strings.TrimSpace(testTerraformPlanEscapedVarStr)
if actual != expected {
t.Fatalf("bad:\n%s", actual)
}
}
func TestContext2Plan_minimal(t *testing.T) {
m := testModule(t, "plan-empty")
p := testProvider("aws")

View File

@ -983,6 +983,18 @@ STATE:
<no state>
`
const testTerraformPlanEscapedVarStr = `
DIFF:
CREATE: aws_instance.foo
foo: "" => "bar-${baz}"
type: "" => "aws_instance"
STATE:
<no state>
`
const testTerraformPlanModulesStr = `
DIFF:

View File

@ -0,0 +1,3 @@
resource "aws_instance" "foo" {
foo = "bar-$${baz}"
}