diff --git a/builtin/providers/aws/resource_aws_iam_group_test.go b/builtin/providers/aws/resource_aws_iam_group_test.go index c36a938b64ed..977889bd655b 100644 --- a/builtin/providers/aws/resource_aws_iam_group_test.go +++ b/builtin/providers/aws/resource_aws_iam_group_test.go @@ -23,14 +23,14 @@ func TestAccAWSIAMGroup_basic(t *testing.T) { Config: testAccAWSGroupConfig, Check: resource.ComposeTestCheckFunc( testAccCheckAWSGroupExists("aws_iam_group.group", &conf), - testAccCheckAWSGroupAttributes(&conf), + testAccCheckAWSGroupAttributes(&conf, "test-group", "/"), ), }, resource.TestStep{ Config: testAccAWSGroupConfig2, Check: resource.ComposeTestCheckFunc( testAccCheckAWSGroupExists("aws_iam_group.group", &conf), - testAccCheckAWSGroupAttributes(&conf), + testAccCheckAWSGroupAttributes(&conf, "test-group2", "/funnypath/"), ), }, }, @@ -92,14 +92,14 @@ func testAccCheckAWSGroupExists(n string, res *iam.GetGroupOutput) resource.Test } } -func testAccCheckAWSGroupAttributes(group *iam.GetGroupOutput) resource.TestCheckFunc { +func testAccCheckAWSGroupAttributes(group *iam.GetGroupOutput, name string, path string) resource.TestCheckFunc { return func(s *terraform.State) error { - if *group.Group.GroupName != "test-group" { - return fmt.Errorf("Bad name: %s", *group.Group.GroupName) + if *group.Group.GroupName != name { + return fmt.Errorf("Bad name: %s when %s was expected", *group.Group.GroupName, name) } - if *group.Group.Path != "/" { - return fmt.Errorf("Bad path: %s", *group.Group.Path) + if *group.Group.Path != path { + return fmt.Errorf("Bad path: %s when %s was expected", *group.Group.Path, path) } return nil