summaryrefslogtreecommitdiff
path: root/vendor/github.com/hashicorp/terraform/terraform/testing.go
blob: 3f0418d9273d0b8bf78c348af8534d9ccc59c967 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package terraform

import (
	"os"
	"testing"
)

// TestStateFile writes the given state to the path.
func TestStateFile(t *testing.T, path string, state *State) {
	f, err := os.Create(path)
	if err != nil {
		t.Fatalf("err: %s", err)
	}
	defer f.Close()

	if err := WriteState(state, f); err != nil {
		t.Fatalf("err: %s", err)
	}
}