Skip to content

Commit cb26194

Browse files
committed
chore: implement template test with settings (#69)
1 parent 9e60a0d commit cb26194

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

provision/generators/plop/templates/test.append.hbs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,23 @@ import (
1010
func Test{{pascalCase testName}}Success(t *testing.T) {
1111
t.Parallel()
1212

13-
visibility := "public"
14-
repository := "test-repository"
1513
description := "description"
14+
repository := "test-repository"
15+
visibility := "public"
16+
settings := map[string]interface{}{
17+
"auto_init": true,
18+
}
19+
1620

1721
terraformOptions := &terraform.Options{
1822
// The path to where your Terraform code is located
1923
TerraformDir: "repository-{{dashCase testName}}",
2024
Upgrade: true,
2125
Vars: map[string]interface{}{
22-
"visibility": visibility,
23-
"name": repository,
2426
"description": description,
27+
"name": repository,
28+
"settings": settings,
29+
"visibility": visibility,
2530
},
2631
}
2732

provision/generators/plop/templates/test/main.append.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ module "main" {
88
name = var.name
99
description = var.description
1010
visibility = var.visibility
11+
settings = var.settings
1112
}

provision/generators/plop/templates/test/variables.append.hbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ variable "description" {
3030
type = string
3131
description = "description of repository."
3232
}
33+
34+
variable "settings" {
35+
type = any
36+
description = "settings for github repository."
37+
}

0 commit comments

Comments
 (0)