core: Context plan tests expect a new error message for prevent_destroy

This error message has been revised as part of changing it to use
diagnostics instead of an error string directly.
This commit is contained in:
Martin Atkins 2018-05-22 11:45:07 -07:00
parent 5a77045a61
commit d6d655f21d

View File

@ -908,7 +908,7 @@ func TestContext2Plan_preventDestroy_bad(t *testing.T) {
plan, err := ctx.Plan()
expectedErr := "aws_instance.foo: the plan would destroy"
expectedErr := "aws_instance.foo has lifecycle.prevent_destroy"
if !strings.Contains(fmt.Sprintf("%s", err), expectedErr) {
t.Fatalf("expected err would contain %q\nerr: %s\nplan: %s",
expectedErr, err, plan)
@ -989,7 +989,7 @@ func TestContext2Plan_preventDestroy_countBad(t *testing.T) {
plan, err := ctx.Plan()
expectedErr := "aws_instance.foo.1: the plan would destroy"
expectedErr := "aws_instance.foo[1] has lifecycle.prevent_destroy"
if !strings.Contains(fmt.Sprintf("%s", err), expectedErr) {
t.Fatalf("expected err would contain %q\nerr: %s\nplan: %s",
expectedErr, err, plan)
@ -1113,7 +1113,7 @@ func TestContext2Plan_preventDestroy_destroyPlan(t *testing.T) {
plan, err := ctx.Plan()
expectedErr := "aws_instance.foo: the plan would destroy"
expectedErr := "aws_instance.foo has lifecycle.prevent_destroy"
if !strings.Contains(fmt.Sprintf("%s", err), expectedErr) {
t.Fatalf("expected err would contain %q\nerr: %s\nplan: %s",
expectedErr, err, plan)