core: update fixture to match schema

This commit is contained in:
James Bardin 2018-05-30 10:22:34 -04:00 committed by Martin Atkins
parent a5c3c454ab
commit 1350ed8e3a
2 changed files with 8 additions and 6 deletions

View File

@ -4110,7 +4110,7 @@ func TestContext2Apply_outputOrphanModule(t *testing.T) {
actual = strings.TrimSpace(state.String()) actual = strings.TrimSpace(state.String())
if actual != "" { if actual != "" {
t.Fatalf("wrong result\n\ngot:\n%s\n\nwant: no state at all", actual) t.Fatalf("expected no state, got:\n%s", actual)
} }
} }
@ -5247,9 +5247,9 @@ func TestContext2Apply_provisionerDestroyRef(t *testing.T) {
p.ApplyFn = testApplyFn p.ApplyFn = testApplyFn
p.DiffFn = testDiffFn p.DiffFn = testDiffFn
pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error { pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error {
val, ok := c.Config["foo"] val, ok := c.Config["command"]
if !ok || val != "hello" { if !ok || val != "hello" {
return fmt.Errorf("bad value for foo: %v %#v", val, c) return fmt.Errorf("bad value for command: %v %#v", val, c)
} }
return nil return nil
@ -5265,9 +5265,10 @@ func TestContext2Apply_provisionerDestroyRef(t *testing.T) {
Primary: &InstanceState{ Primary: &InstanceState{
ID: "bar", ID: "bar",
Attributes: map[string]string{ Attributes: map[string]string{
"key": "hello", "value": "hello",
}, },
}, },
Provider: "provider.aws",
}, },
"aws_instance.foo": &ResourceState{ "aws_instance.foo": &ResourceState{
@ -5275,6 +5276,7 @@ func TestContext2Apply_provisionerDestroyRef(t *testing.T) {
Primary: &InstanceState{ Primary: &InstanceState{
ID: "bar", ID: "bar",
}, },
Provider: "provider.aws",
}, },
}, },
}, },

View File

@ -1,12 +1,12 @@
resource "aws_instance" "bar" { resource "aws_instance" "bar" {
key = "hello" value = "hello"
} }
resource "aws_instance" "foo" { resource "aws_instance" "foo" {
foo = "bar" foo = "bar"
provisioner "shell" { provisioner "shell" {
foo = "${aws_instance.bar.key}" command = "${aws_instance.bar.value}"
when = "destroy" when = "destroy"
} }
} }