@@ -418,20 +418,15 @@ resource "github_repository" "test" {
418418 }
419419 ` , testRepoName , testAccConf .testPublicTemplateRepositoryOwner , testAccConf .testPublicTemplateRepository )
420420
421- check := resource .ComposeTestCheckFunc (
422- resource .TestCheckResourceAttr (
423- "github_repository.test" , "is_template" ,
424- "false" ,
425- ),
426- )
427-
428421 resource .Test (t , resource.TestCase {
429422 PreCheck : func () { skipUnauthenticated (t ) },
430423 ProviderFactories : providerFactories ,
431424 Steps : []resource.TestStep {
432425 {
433426 Config : config ,
434- Check : check ,
427+ Check : resource .ComposeTestCheckFunc (
428+ resource .TestCheckResourceAttr ("github_repository.test" , "is_template" , "false" ),
429+ ),
435430 },
436431 },
437432 })
@@ -453,20 +448,15 @@ resource "github_repository" "test" {
453448 }
454449 ` , testRepoName , testAccConf .owner , testAccConf .testOrgTemplateRepository )
455450
456- check := resource .ComposeTestCheckFunc (
457- resource .TestCheckResourceAttr (
458- "github_repository.test" , "is_template" ,
459- "false" ,
460- ),
461- )
462-
463451 resource .Test (t , resource.TestCase {
464452 PreCheck : func () { skipUnlessHasOrgs (t ) },
465453 ProviderFactories : providerFactories ,
466454 Steps : []resource.TestStep {
467455 {
468456 Config : config ,
469- Check : check ,
457+ Check : resource .ComposeTestCheckFunc (
458+ resource .TestCheckResourceAttr ("github_repository.test" , "is_template" , "false" ),
459+ ),
470460 },
471461 },
472462 })
@@ -791,40 +781,23 @@ resource "github_repository" "test" {
791781 ` , testRepoName , updatedMergeCommitTitle , updatedMergeCommitMessage ),
792782 }
793783
794- checks := map [string ]resource.TestCheckFunc {
795- "before" : resource .ComposeTestCheckFunc (
796- resource .TestCheckResourceAttr (
797- "github_repository.test" , "merge_commit_title" ,
798- mergeCommitTitle ,
799- ),
800- resource .TestCheckResourceAttr (
801- "github_repository.test" , "merge_commit_message" ,
802- mergeCommitMessage ,
803- ),
804- ),
805- "after" : resource .ComposeTestCheckFunc (
806- resource .TestCheckResourceAttr (
807- "github_repository.test" , "merge_commit_title" ,
808- updatedMergeCommitTitle ,
809- ),
810- resource .TestCheckResourceAttr (
811- "github_repository.test" , "merge_commit_message" ,
812- updatedMergeCommitMessage ,
813- ),
814- ),
815- }
816-
817784 resource .Test (t , resource.TestCase {
818785 PreCheck : func () { skipUnauthenticated (t ) },
819786 ProviderFactories : providerFactories ,
820787 Steps : []resource.TestStep {
821788 {
822789 Config : configs ["before" ],
823- Check : checks ["before" ],
790+ Check : resource .ComposeTestCheckFunc (
791+ resource .TestCheckResourceAttr ("github_repository.test" , "merge_commit_title" , mergeCommitTitle ),
792+ resource .TestCheckResourceAttr ("github_repository.test" , "merge_commit_message" , mergeCommitMessage ),
793+ ),
824794 },
825795 {
826796 Config : configs ["after" ],
827- Check : checks ["after" ],
797+ Check : resource .ComposeTestCheckFunc (
798+ resource .TestCheckResourceAttr ("github_repository.test" , "merge_commit_title" , updatedMergeCommitTitle ),
799+ resource .TestCheckResourceAttr ("github_repository.test" , "merge_commit_message" , updatedMergeCommitMessage ),
800+ ),
828801 },
829802 },
830803 })
@@ -860,24 +833,12 @@ resource "github_repository" "test" {
860833
861834 checks := map [string ]resource.TestCheckFunc {
862835 "before" : resource .ComposeTestCheckFunc (
863- resource .TestCheckResourceAttr (
864- "github_repository.test" , "squash_merge_commit_title" ,
865- squashMergeCommitTitle ,
866- ),
867- resource .TestCheckResourceAttr (
868- "github_repository.test" , "squash_merge_commit_message" ,
869- squashMergeCommitMessage ,
870- ),
836+ resource .TestCheckResourceAttr ("github_repository.test" , "squash_merge_commit_title" , squashMergeCommitTitle ),
837+ resource .TestCheckResourceAttr ("github_repository.test" , "squash_merge_commit_message" , squashMergeCommitMessage ),
871838 ),
872839 "after" : resource .ComposeTestCheckFunc (
873- resource .TestCheckResourceAttr (
874- "github_repository.test" , "squash_merge_commit_title" ,
875- updatedSquashMergeCommitTitle ,
876- ),
877- resource .TestCheckResourceAttr (
878- "github_repository.test" , "squash_merge_commit_message" ,
879- updatedSquashMergeCommitMessage ,
880- ),
840+ resource .TestCheckResourceAttr ("github_repository.test" , "squash_merge_commit_title" , updatedSquashMergeCommitTitle ),
841+ resource .TestCheckResourceAttr ("github_repository.test" , "squash_merge_commit_message" , updatedSquashMergeCommitMessage ),
881842 ),
882843 }
883844
0 commit comments