Skip to content

Commit ba3c331

Browse files
committed
update generator testscript test
1 parent 76ca508 commit ba3c331

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

testdata/script/generator.txtar

+23-5
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,40 @@ env GOCOVERDIR=.
44
exec go-scaffold test-template --input-file input.yaml --output-directory output
55
! stderr .
66

7-
cmp output/my-project/my-project.txt expected_file
7+
cmp output/my-project/my-project.txt expected/my-project.txt
8+
cmp output/compose.yaml expected/compose.yaml
89

910
-- input.yaml --
10-
project_name: my-project
11+
project_name: My Project
12+
port: 4000
1113
-- test-template/template.yaml --
1214
title: My Template
1315
version: v0.0.1-test
1416
type: object
1517
schema:
1618
project_name:
1719
type: string
20+
port:
21+
type: integer
1822
required:
1923
- project_name
2024
steps:
2125
- source: ./template
22-
-- test-template/template/{{ project_name }}/{{ project_name }}.txt --
26+
-- test-template/template/{{ project_name | slugify }}/{{ project_name | slugify }}.txt --
2327
{{ project_name }}
24-
-- expected_file --
25-
my-project
28+
-- test-template/template/compose.yaml --
29+
services:
30+
backend:
31+
image: {{ project_name | slugify }}
32+
build: .
33+
ports:
34+
- {{ port }}:4000
35+
-- expected/my-project.txt --
36+
My Project
37+
-- expected/compose.yaml --
38+
services:
39+
backend:
40+
image: my-project
41+
build: .
42+
ports:
43+
- 4000:4000

0 commit comments

Comments
 (0)