helper/resource: Fix duplicated function testConfig

An earlier change introduced a new function testConfig to the main code
for this package, which conflicted with a function of the same name in
the test code.

Here we rename the function from the test code, allowing for the more
generally-named testConfig to be the one in the main code.
This commit is contained in:
Martin Atkins 2018-10-01 16:17:23 -07:00
parent d11dd20bf3
commit 1908aff476
1 changed files with 3 additions and 5 deletions

View File

@ -49,7 +49,7 @@ func TestMapValidate(t *testing.T) {
var es []error var es []error
// Valid // Valid
c = testConfig(t, map[string]interface{}{"foo": "bar"}) c = testConfigForMap(t, map[string]interface{}{"foo": "bar"})
ws, es = m.Validate("aws_elb", c) ws, es = m.Validate("aws_elb", c)
if len(ws) > 0 { if len(ws) > 0 {
t.Fatalf("bad: %#v", ws) t.Fatalf("bad: %#v", ws)
@ -59,7 +59,7 @@ func TestMapValidate(t *testing.T) {
} }
// Invalid // Invalid
c = testConfig(t, map[string]interface{}{}) c = testConfigForMap(t, map[string]interface{}{})
ws, es = m.Validate("aws_elb", c) ws, es = m.Validate("aws_elb", c)
if len(ws) > 0 { if len(ws) > 0 {
t.Fatalf("bad: %#v", ws) t.Fatalf("bad: %#v", ws)
@ -69,9 +69,7 @@ func TestMapValidate(t *testing.T) {
} }
} }
func testConfig( func testConfigForMap(t *testing.T, c map[string]interface{}) *terraform.ResourceConfig {
t *testing.T,
c map[string]interface{}) *terraform.ResourceConfig {
r, err := tfconfig.NewRawConfig(c) r, err := tfconfig.NewRawConfig(c)
if err != nil { if err != nil {
t.Fatalf("bad: %s", err) t.Fatalf("bad: %s", err)