cucumber_analytics 1.4.2 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +7 -0
- data/README.rdoc +4 -0
- data/Rakefile +1 -1
- data/cucumber_analytics.gemspec +3 -1
- data/features/modeling/background_modeling.feature +27 -13
- data/features/modeling/background_output.feature +130 -0
- data/features/modeling/directory_modeling.feature +11 -6
- data/features/modeling/directory_output.feature +13 -0
- data/features/modeling/doc_string_modeling.feature +18 -11
- data/features/modeling/doc_string_output.feature +71 -0
- data/features/modeling/example_modeling.feature +30 -19
- data/features/modeling/example_output.feature +192 -0
- data/features/modeling/feature_file_modeling.feature +9 -4
- data/features/modeling/feature_file_output.feature +13 -0
- data/features/modeling/feature_modeling.feature +33 -20
- data/features/modeling/feature_output.feature +244 -0
- data/features/modeling/outline_modeling.feature +29 -16
- data/features/modeling/outline_output.feature +197 -0
- data/features/modeling/row_modeling.feature +9 -4
- data/features/modeling/row_output.feature +27 -0
- data/features/modeling/scenario_modeling.feature +27 -14
- data/features/modeling/scenario_output.feature +147 -0
- data/features/modeling/step_modeling.feature +13 -8
- data/features/modeling/step_output.feature +52 -0
- data/features/modeling/table_modeling.feature +9 -4
- data/features/modeling/table_output.feature +42 -0
- data/features/modeling/table_row_modeling.feature +9 -4
- data/features/modeling/table_row_output.feature +27 -0
- data/features/modeling/tag_modeling.feature +10 -5
- data/features/modeling/tag_output.feature +16 -0
- data/features/step_definitions/action_steps.rb +3 -0
- data/features/step_definitions/background_steps.rb +17 -4
- data/features/step_definitions/directory_steps.rb +11 -0
- data/features/step_definitions/doc_string_steps.rb +18 -15
- data/features/step_definitions/feature_file_steps.rb +12 -1
- data/features/step_definitions/feature_steps.rb +23 -6
- data/features/step_definitions/outline_steps.rb +70 -9
- data/features/step_definitions/step_steps.rb +9 -1
- data/features/step_definitions/table_steps.rb +35 -2
- data/features/step_definitions/tag_steps.rb +8 -0
- data/features/step_definitions/test_steps.rb +14 -3
- data/features/step_definitions/verification_steps.rb +9 -0
- data/features/support/env.rb +1 -0
- data/lib/cucumber_analytics/background.rb +12 -0
- data/lib/cucumber_analytics/directory.rb +5 -0
- data/lib/cucumber_analytics/doc_string.rb +22 -0
- data/lib/cucumber_analytics/example.rb +55 -0
- data/lib/cucumber_analytics/feature.rb +26 -0
- data/lib/cucumber_analytics/feature_element.rb +25 -1
- data/lib/cucumber_analytics/feature_file.rb +5 -0
- data/lib/cucumber_analytics/outline.rb +18 -0
- data/lib/cucumber_analytics/parsing.rb +3 -1
- data/lib/cucumber_analytics/row.rb +5 -0
- data/lib/cucumber_analytics/scenario.rb +13 -0
- data/lib/cucumber_analytics/step.rb +8 -0
- data/lib/cucumber_analytics/table.rb +21 -0
- data/lib/cucumber_analytics/table_row.rb +5 -0
- data/lib/cucumber_analytics/tag.rb +5 -0
- data/lib/cucumber_analytics/taggable.rb +4 -0
- data/lib/cucumber_analytics/test_element.rb +8 -0
- data/lib/cucumber_analytics/version.rb +1 -1
- data/spec/integration/background_integration_spec.rb +12 -0
- data/spec/integration/example_integration_spec.rb +21 -0
- data/spec/integration/feature_integration_spec.rb +29 -0
- data/spec/integration/outline_integration_spec.rb +22 -0
- data/spec/integration/scenario_integration_spec.rb +16 -0
- data/spec/integration/step_integration_spec.rb +20 -0
- data/spec/integration/table_integration_spec.rb +11 -0
- data/spec/unit/background_unit_spec.rb +28 -0
- data/spec/unit/directory_unit_spec.rb +12 -0
- data/spec/unit/doc_string_unit_spec.rb +43 -3
- data/spec/unit/example_unit_spec.rb +53 -0
- data/spec/unit/feature_element_unit_specs.rb +9 -2
- data/spec/unit/feature_file_unit_spec.rb +12 -0
- data/spec/unit/feature_unit_spec.rb +30 -0
- data/spec/unit/outline_unit_spec.rb +30 -0
- data/spec/unit/row_unit_spec.rb +19 -7
- data/spec/unit/scenario_unit_spec.rb +30 -0
- data/spec/unit/step_unit_spec.rb +25 -1
- data/spec/unit/table_row_unit_spec.rb +12 -0
- data/spec/unit/table_unit_spec.rb +25 -0
- data/spec/unit/tag_unit_spec.rb +12 -0
- metadata +165 -86
- checksums.yaml +0 -15
@@ -0,0 +1,192 @@
|
|
1
|
+
Feature: Outputting example elements
|
2
|
+
|
3
|
+
The output of an element model is a representation of the element as it would
|
4
|
+
appear in gherkin.
|
5
|
+
|
6
|
+
|
7
|
+
Scenario: Output of an example that does not have a name
|
8
|
+
Given an example element based on the following gherkin:
|
9
|
+
"""
|
10
|
+
Examples:
|
11
|
+
|param|
|
12
|
+
"""
|
13
|
+
When it is outputted
|
14
|
+
Then the following text is provided:
|
15
|
+
"""
|
16
|
+
Examples:
|
17
|
+
| param |
|
18
|
+
"""
|
19
|
+
|
20
|
+
Scenario: Output of an example that does have a name
|
21
|
+
Given an example element based on the following gherkin:
|
22
|
+
"""
|
23
|
+
Examples: with a name
|
24
|
+
|param|
|
25
|
+
"""
|
26
|
+
When it is outputted
|
27
|
+
Then the following text is provided:
|
28
|
+
"""
|
29
|
+
Examples: with a name
|
30
|
+
| param |
|
31
|
+
"""
|
32
|
+
|
33
|
+
Scenario: Output of an example that does not have tags
|
34
|
+
Given an example element based on the following gherkin:
|
35
|
+
"""
|
36
|
+
Examples:
|
37
|
+
|param|
|
38
|
+
"""
|
39
|
+
When it is outputted
|
40
|
+
Then the following text is provided:
|
41
|
+
"""
|
42
|
+
Examples:
|
43
|
+
| param |
|
44
|
+
"""
|
45
|
+
|
46
|
+
Scenario: Output of an example that does have tags
|
47
|
+
Given an example element based on the following gherkin:
|
48
|
+
"""
|
49
|
+
@tag1@tag2
|
50
|
+
@tag3
|
51
|
+
Examples:
|
52
|
+
|param|
|
53
|
+
"""
|
54
|
+
When it is outputted
|
55
|
+
Then the following text is provided:
|
56
|
+
"""
|
57
|
+
@tag1 @tag2 @tag3
|
58
|
+
Examples:
|
59
|
+
| param |
|
60
|
+
"""
|
61
|
+
|
62
|
+
Scenario: Output of an example that has a description, no first line buffer
|
63
|
+
Given an example element based on the following gherkin:
|
64
|
+
"""
|
65
|
+
Examples:
|
66
|
+
Some description.
|
67
|
+
Some more description.
|
68
|
+
|param|
|
69
|
+
"""
|
70
|
+
When it is outputted
|
71
|
+
Then the following text is provided:
|
72
|
+
"""
|
73
|
+
Examples:
|
74
|
+
|
75
|
+
Some description.
|
76
|
+
Some more description.
|
77
|
+
|
78
|
+
| param |
|
79
|
+
"""
|
80
|
+
|
81
|
+
Scenario: Output of an example that has a description, first line is blank
|
82
|
+
Given an example element based on the following gherkin:
|
83
|
+
"""
|
84
|
+
Examples:
|
85
|
+
|
86
|
+
Some description.
|
87
|
+
Some more description.
|
88
|
+
|param|
|
89
|
+
"""
|
90
|
+
When it is outputted
|
91
|
+
Then the following text is provided:
|
92
|
+
"""
|
93
|
+
Examples:
|
94
|
+
|
95
|
+
Some description.
|
96
|
+
Some more description.
|
97
|
+
|
98
|
+
| param |
|
99
|
+
"""
|
100
|
+
|
101
|
+
Scenario: Output of an example that has a description, first line is only whitespace
|
102
|
+
Given an example element based on the following gherkin:
|
103
|
+
"""
|
104
|
+
Examples:
|
105
|
+
|
106
|
+
Some description.
|
107
|
+
Some more description.
|
108
|
+
|param|
|
109
|
+
"""
|
110
|
+
When it is outputted
|
111
|
+
Then the following text is provided:
|
112
|
+
"""
|
113
|
+
Examples:
|
114
|
+
|
115
|
+
Some description.
|
116
|
+
Some more description.
|
117
|
+
|
118
|
+
| param |
|
119
|
+
"""
|
120
|
+
|
121
|
+
Scenario: Output of an example that has one rows
|
122
|
+
Given an example element based on the following gherkin:
|
123
|
+
"""
|
124
|
+
Examples:
|
125
|
+
|param1|param2|
|
126
|
+
|value1|value2|
|
127
|
+
"""
|
128
|
+
When it is outputted
|
129
|
+
Then the following text is provided:
|
130
|
+
"""
|
131
|
+
Examples:
|
132
|
+
| param1 | param2 |
|
133
|
+
| value1 | value2 |
|
134
|
+
"""
|
135
|
+
|
136
|
+
Scenario: Output of an example that has multiple rows
|
137
|
+
Given an example element based on the following gherkin:
|
138
|
+
"""
|
139
|
+
Examples:
|
140
|
+
|param1|param2|
|
141
|
+
|value1|value2|
|
142
|
+
|value3|value4|
|
143
|
+
"""
|
144
|
+
When it is outputted
|
145
|
+
Then the following text is provided:
|
146
|
+
"""
|
147
|
+
Examples:
|
148
|
+
| param1 | param2 |
|
149
|
+
| value1 | value2 |
|
150
|
+
| value3 | value4 |
|
151
|
+
"""
|
152
|
+
|
153
|
+
Scenario: Output of an example that contains all possible parts
|
154
|
+
Given an example element based on the following gherkin:
|
155
|
+
"""
|
156
|
+
@tag1@tag2
|
157
|
+
@tag3
|
158
|
+
Examples: with a name
|
159
|
+
Some description.
|
160
|
+
Some more description.
|
161
|
+
|param1|param2|
|
162
|
+
|value1|value2|
|
163
|
+
|value3|value4|
|
164
|
+
"""
|
165
|
+
When it is outputted
|
166
|
+
Then the following text is provided:
|
167
|
+
"""
|
168
|
+
@tag1 @tag2 @tag3
|
169
|
+
Examples: with a name
|
170
|
+
|
171
|
+
Some description.
|
172
|
+
Some more description.
|
173
|
+
|
174
|
+
| param1 | param2 |
|
175
|
+
| value1 | value2 |
|
176
|
+
| value3 | value4 |
|
177
|
+
"""
|
178
|
+
|
179
|
+
Scenario: Whitespace buffers are based on the longest value or parameter in a column
|
180
|
+
Given an example element based on the following gherkin:
|
181
|
+
"""
|
182
|
+
Examples:
|
183
|
+
|parameter_name|x|
|
184
|
+
|y|value_name|
|
185
|
+
"""
|
186
|
+
When it is outputted
|
187
|
+
Then the following text is provided:
|
188
|
+
"""
|
189
|
+
Examples:
|
190
|
+
| parameter_name | x |
|
191
|
+
| y | value_name |
|
192
|
+
"""
|
@@ -3,10 +3,12 @@ Feature: Feature files can be modeled.
|
|
3
3
|
|
4
4
|
Acceptance criteria
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
1. All conceptual pieces of a .feature file can be modeled:
|
7
|
+
- the file's name
|
8
|
+
- the file's full path
|
9
|
+
- the file's features (one or zero per file)
|
10
|
+
|
11
|
+
2. Feature files can be outputted in a convenient form
|
10
12
|
|
11
13
|
|
12
14
|
Background: Test file setup.
|
@@ -47,6 +49,9 @@ Feature: Feature files can be modeled.
|
|
47
49
|
| feature_count | 0 |
|
48
50
|
And file "3" has no features
|
49
51
|
|
52
|
+
Scenario: Convenient output of a feature file
|
53
|
+
Then the feature file has convenient output
|
54
|
+
|
50
55
|
Scenario Outline: Feature file models pass all other specifications
|
51
56
|
Exact specifications detailing the API for .feature file models.
|
52
57
|
Given that there are "<additional specifications>" detailing models
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Feature: Outputting feature file elements
|
2
|
+
|
3
|
+
The output of an element model is a representation of the element as it would
|
4
|
+
appear in gherkin.
|
5
|
+
|
6
|
+
|
7
|
+
Scenario: Output of a feature file
|
8
|
+
Given a feature file element based on "some_feature_file.feature"
|
9
|
+
When it is outputted
|
10
|
+
Then the following text is provided:
|
11
|
+
"""
|
12
|
+
path_to/some_feature_file.feature
|
13
|
+
"""
|
@@ -3,17 +3,19 @@ Feature: Features can be modeled.
|
|
3
3
|
|
4
4
|
Acceptance criteria
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
6
|
+
1. All conceptual pieces of a feature can be modeled:
|
7
|
+
- the feature's name
|
8
|
+
- the feature's description
|
9
|
+
- the feature's tags
|
10
|
+
- the feature's scenarios
|
11
|
+
- the feature's outlines
|
12
|
+
- the feature's background
|
13
|
+
- the feature's total number of tests
|
14
|
+
- the feature's total number of test cases
|
15
|
+
- the feature's source line
|
16
|
+
- the feature's raw element
|
17
|
+
|
18
|
+
2. Features can be outputted in a convenient form
|
17
19
|
|
18
20
|
|
19
21
|
Background: Test file setup.
|
@@ -21,11 +23,14 @@ Feature: Features can be modeled.
|
|
21
23
|
"""
|
22
24
|
@a_feature_level_tag @and_another
|
23
25
|
|
24
|
-
|
26
|
+
Feature: The test feature name.
|
27
|
+
|
25
28
|
Some feature description.
|
26
|
-
And some more.
|
27
29
|
|
28
|
-
|
30
|
+
Some more.
|
31
|
+
And some more.
|
32
|
+
|
33
|
+
Background: Some general test setup stuff.
|
29
34
|
* some setup step
|
30
35
|
|
31
36
|
Scenario: The first scenario's name.
|
@@ -86,11 +91,16 @@ Feature: Features can be modeled.
|
|
86
91
|
| source_line | 1 |
|
87
92
|
|
88
93
|
Scenario: The feature's description is modeled.
|
89
|
-
Then
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
+
Then feature "1" has the following description:
|
95
|
+
"""
|
96
|
+
|
97
|
+
Some feature description.
|
98
|
+
|
99
|
+
Some more.
|
100
|
+
And some more.
|
101
|
+
"""
|
102
|
+
And feature "2" has no description
|
103
|
+
And feature "3" has no description
|
94
104
|
|
95
105
|
Scenario: The feature's tags are modeled.
|
96
106
|
Then feature "1" is found to have the following tags:
|
@@ -139,8 +149,11 @@ Feature: Features can be modeled.
|
|
139
149
|
| has_background? | false |
|
140
150
|
And feature "3" has no background
|
141
151
|
|
152
|
+
Scenario: Convenient output of a feature
|
153
|
+
Then the feature has convenient output
|
154
|
+
|
142
155
|
Scenario Outline: Feature models pass all other specifications
|
143
|
-
Exact specifications detailing the API for
|
156
|
+
Exact specifications detailing the API for feature models.
|
144
157
|
Given that there are "<additional specifications>" detailing models
|
145
158
|
When the corresponding specifications are run
|
146
159
|
Then all of those specifications are met
|
@@ -0,0 +1,244 @@
|
|
1
|
+
Feature: Outputting feature elements
|
2
|
+
|
3
|
+
The output of an element model is a representation of the element as it would
|
4
|
+
appear in gherkin.
|
5
|
+
|
6
|
+
|
7
|
+
Scenario: Output of a feature that does not have a name
|
8
|
+
Given a feature element based on the following gherkin:
|
9
|
+
"""
|
10
|
+
Feature:
|
11
|
+
"""
|
12
|
+
When it is outputted
|
13
|
+
Then the following text is provided:
|
14
|
+
"""
|
15
|
+
Feature:
|
16
|
+
"""
|
17
|
+
|
18
|
+
Scenario: Output of a feature that does have a name
|
19
|
+
Given a feature element based on the following gherkin:
|
20
|
+
"""
|
21
|
+
Feature: with a name
|
22
|
+
"""
|
23
|
+
When it is outputted
|
24
|
+
Then the following text is provided:
|
25
|
+
"""
|
26
|
+
Feature: with a name
|
27
|
+
"""
|
28
|
+
|
29
|
+
Scenario: Output of a feature that has tags
|
30
|
+
Given a feature element based on the following gherkin:
|
31
|
+
"""
|
32
|
+
@tag1@tag2
|
33
|
+
@tag3
|
34
|
+
Feature:
|
35
|
+
"""
|
36
|
+
When it is outputted
|
37
|
+
Then the following text is provided:
|
38
|
+
"""
|
39
|
+
@tag1 @tag2 @tag3
|
40
|
+
Feature:
|
41
|
+
"""
|
42
|
+
|
43
|
+
Scenario: Output of a feature that has a description, no first line buffer
|
44
|
+
Given a feature element based on the following gherkin:
|
45
|
+
"""
|
46
|
+
Feature:
|
47
|
+
Some description.
|
48
|
+
Some more description.
|
49
|
+
"""
|
50
|
+
When it is outputted
|
51
|
+
Then the following text is provided:
|
52
|
+
"""
|
53
|
+
Feature:
|
54
|
+
|
55
|
+
Some description.
|
56
|
+
Some more description.
|
57
|
+
"""
|
58
|
+
|
59
|
+
Scenario: Output of a feature that has a description, first line is blank
|
60
|
+
Given a feature element based on the following gherkin:
|
61
|
+
"""
|
62
|
+
Feature:
|
63
|
+
|
64
|
+
Some description.
|
65
|
+
Some more description.
|
66
|
+
"""
|
67
|
+
When it is outputted
|
68
|
+
Then the following text is provided:
|
69
|
+
"""
|
70
|
+
Feature:
|
71
|
+
|
72
|
+
Some description.
|
73
|
+
Some more description.
|
74
|
+
"""
|
75
|
+
|
76
|
+
Scenario: Output of a feature that has a description, first line is only whitespace
|
77
|
+
Given a feature element based on the following gherkin:
|
78
|
+
"""
|
79
|
+
Feature:
|
80
|
+
|
81
|
+
Some description.
|
82
|
+
Some more description.
|
83
|
+
"""
|
84
|
+
When it is outputted
|
85
|
+
Then the following text is provided:
|
86
|
+
"""
|
87
|
+
Feature:
|
88
|
+
|
89
|
+
Some description.
|
90
|
+
Some more description.
|
91
|
+
"""
|
92
|
+
|
93
|
+
Scenario: Output of a feature that has a background
|
94
|
+
Given a feature element based on the following gherkin:
|
95
|
+
"""
|
96
|
+
Feature:
|
97
|
+
|
98
|
+
Background:
|
99
|
+
* a step
|
100
|
+
* another step
|
101
|
+
"""
|
102
|
+
When it is outputted
|
103
|
+
Then the following text is provided:
|
104
|
+
"""
|
105
|
+
Feature:
|
106
|
+
|
107
|
+
Background:
|
108
|
+
* a step
|
109
|
+
* another step
|
110
|
+
"""
|
111
|
+
|
112
|
+
Scenario: Output of a feature that has a scenario
|
113
|
+
Given a feature element based on the following gherkin:
|
114
|
+
"""
|
115
|
+
Feature:
|
116
|
+
|
117
|
+
Scenario:
|
118
|
+
* a step
|
119
|
+
* another step
|
120
|
+
"""
|
121
|
+
When it is outputted
|
122
|
+
Then the following text is provided:
|
123
|
+
"""
|
124
|
+
Feature:
|
125
|
+
|
126
|
+
Scenario:
|
127
|
+
* a step
|
128
|
+
* another step
|
129
|
+
"""
|
130
|
+
|
131
|
+
Scenario: Output of a feature that has an outline
|
132
|
+
Given a feature element based on the following gherkin:
|
133
|
+
"""
|
134
|
+
Feature:
|
135
|
+
|
136
|
+
Scenario Outline:
|
137
|
+
* a step
|
138
|
+
* another step
|
139
|
+
Examples:
|
140
|
+
|param|
|
141
|
+
"""
|
142
|
+
When it is outputted
|
143
|
+
Then the following text is provided:
|
144
|
+
"""
|
145
|
+
Feature:
|
146
|
+
|
147
|
+
Scenario Outline:
|
148
|
+
* a step
|
149
|
+
* another step
|
150
|
+
|
151
|
+
Examples:
|
152
|
+
| param |
|
153
|
+
"""
|
154
|
+
|
155
|
+
Scenario: Output of a feature that contains all possible parts
|
156
|
+
Given a feature element based on the following gherkin:
|
157
|
+
"""
|
158
|
+
@tag1@tag2
|
159
|
+
@tag3
|
160
|
+
Feature: A feature with everything it could have
|
161
|
+
Including a description
|
162
|
+
and then some.
|
163
|
+
Background:
|
164
|
+
Background
|
165
|
+
description
|
166
|
+
* a step
|
167
|
+
|value1|
|
168
|
+
* another step
|
169
|
+
@scenario_tag
|
170
|
+
Scenario:
|
171
|
+
Scenario
|
172
|
+
description
|
173
|
+
* a step
|
174
|
+
* another step
|
175
|
+
\"\"\"
|
176
|
+
some text
|
177
|
+
\"\"\"
|
178
|
+
@outline_tag
|
179
|
+
Scenario Outline:
|
180
|
+
Outline
|
181
|
+
description
|
182
|
+
* a step
|
183
|
+
|value2|
|
184
|
+
* another step
|
185
|
+
\"\"\"
|
186
|
+
some text
|
187
|
+
\"\"\"
|
188
|
+
@example_tag
|
189
|
+
Examples:
|
190
|
+
Example
|
191
|
+
description
|
192
|
+
|param|
|
193
|
+
"""
|
194
|
+
When it is outputted
|
195
|
+
Then the following text is provided:
|
196
|
+
"""
|
197
|
+
@tag1 @tag2 @tag3
|
198
|
+
Feature: A feature with everything it could have
|
199
|
+
|
200
|
+
Including a description
|
201
|
+
and then some.
|
202
|
+
|
203
|
+
Background:
|
204
|
+
|
205
|
+
Background
|
206
|
+
description
|
207
|
+
|
208
|
+
* a step
|
209
|
+
| value1 |
|
210
|
+
* another step
|
211
|
+
|
212
|
+
@scenario_tag
|
213
|
+
Scenario:
|
214
|
+
|
215
|
+
Scenario
|
216
|
+
description
|
217
|
+
|
218
|
+
* a step
|
219
|
+
* another step
|
220
|
+
\"\"\"
|
221
|
+
some text
|
222
|
+
\"\"\"
|
223
|
+
|
224
|
+
@outline_tag
|
225
|
+
Scenario Outline:
|
226
|
+
|
227
|
+
Outline
|
228
|
+
description
|
229
|
+
|
230
|
+
* a step
|
231
|
+
| value2 |
|
232
|
+
* another step
|
233
|
+
\"\"\"
|
234
|
+
some text
|
235
|
+
\"\"\"
|
236
|
+
|
237
|
+
@example_tag
|
238
|
+
Examples:
|
239
|
+
|
240
|
+
Example
|
241
|
+
description
|
242
|
+
|
243
|
+
| param |
|
244
|
+
"""
|