-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathapp.feature
82 lines (72 loc) · 2.45 KB
/
app.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Feature: Application command line tool
Scenario: User wants to generate the output in given format
When <format> is given
And <feature> is provided
Then the output should be generated
Examples:
| <feature> | <format> | <assertion> |
| app.feature | go | does |
| app.feature | json | does |
| app.feature | raw | does |
| app.feature | invalid | does not |
| notfound.feature | raw | does not |
Scenario: User wants to see usage information
When <flag> is provided
Then usage should be printed
Examples:
| <flag> |
| --help |
Scenario: User wants to list built-in templates
When <flag> is provided
Then templates should be printed
Examples:
| <flag> |
| --list |
Scenario: User wants to use custom template
When <template> is provided
And <feature> is provided
Then the output should be generated
Examples:
| <feature> | <template> |
| app.feature | ../assets/std.struct.v1.go.tmpl |
| app.feature | @/std.struct.v1.go.tmpl |
Scenario: User wants to set custom package
When <package> is provided
Then the output should contain <package>
Examples:
| <package> |
| app_test |
| example_test |
Scenario: User wants to generate a permanent json output
When -format is json
And -permanent-ids is <TheSameIDs>
Then calling generation twice will produce the same output <TheSameIDs>
Examples:
| <TheSameIDs> |
| true |
| false |
Scenario: User gives an invalid flag
When flag -invalid is provided
Then a generation failed
Scenario: User wants to know version
When <flag> is provided
Then version is printed
Examples:
| <flag> |
| --version |
| -version |
Scenario: User specifies a file, but the file is not found
When inexistent <template> is provided
And <feature> is provided
Then the user receives an error
Examples:
| <feature> | <template> |
| app.feature | not_found |
Scenario: User wants to run tests in parallel
When `-go-parallel` is provided
And `scenario.feature` is given
Then generated code contains `t.Parallel()`
Scenario: User wants to run tests sequentially
When `-go-parallel` is not provided
And `scenario.feature` is given
Then generated code doesn't contain `t.Parallel()`