cuke_linter 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +217 -211
- data/LICENSE.txt +21 -21
- data/README.md +160 -160
- data/cuke_linter.gemspec +59 -58
- data/exe/cuke_linter +112 -112
- data/lib/cuke_linter/configuration.rb +45 -45
- data/lib/cuke_linter/default_linters.rb +32 -32
- data/lib/cuke_linter/formatters/pretty_formatter.rb +84 -84
- data/lib/cuke_linter/gherkin.rb +10 -10
- data/lib/cuke_linter/linter_registration.rb +32 -32
- data/lib/cuke_linter/linters/background_does_more_than_setup_linter.rb +35 -35
- data/lib/cuke_linter/linters/element_with_common_tags_linter.rb +49 -49
- data/lib/cuke_linter/linters/element_with_duplicate_tags_linter.rb +48 -48
- data/lib/cuke_linter/linters/element_with_too_many_tags_linter.rb +46 -46
- data/lib/cuke_linter/linters/example_without_name_linter.rb +19 -19
- data/lib/cuke_linter/linters/feature_file_with_invalid_name_linter.rb +20 -20
- data/lib/cuke_linter/linters/feature_file_with_mismatched_name_linter.rb +25 -25
- data/lib/cuke_linter/linters/feature_with_too_many_different_tags_linter.rb +35 -35
- data/lib/cuke_linter/linters/feature_without_description_linter.rb +19 -19
- data/lib/cuke_linter/linters/feature_without_name_linter.rb +19 -19
- data/lib/cuke_linter/linters/feature_without_scenarios_linter.rb +23 -23
- data/lib/cuke_linter/linters/linter.rb +42 -42
- data/lib/cuke_linter/linters/outline_with_single_example_row_linter.rb +22 -22
- data/lib/cuke_linter/linters/single_test_background_linter.rb +19 -19
- data/lib/cuke_linter/linters/step_with_end_period_linter.rb +19 -19
- data/lib/cuke_linter/linters/step_with_too_many_characters_linter.rb +38 -38
- data/lib/cuke_linter/linters/test_name_with_too_many_characters_linter.rb +38 -38
- data/lib/cuke_linter/linters/test_should_use_background_linter.rb +80 -80
- data/lib/cuke_linter/linters/test_with_action_step_as_final_step_linter.rb +33 -33
- data/lib/cuke_linter/linters/test_with_bad_name_linter.rb +23 -23
- data/lib/cuke_linter/linters/test_with_no_action_step_linter.rb +33 -33
- data/lib/cuke_linter/linters/test_with_no_name_linter.rb +19 -19
- data/lib/cuke_linter/linters/test_with_no_verification_step_linter.rb +33 -33
- data/lib/cuke_linter/linters/test_with_setup_step_after_action_step_linter.rb +46 -46
- data/lib/cuke_linter/linters/test_with_setup_step_after_verification_step_linter.rb +46 -46
- data/lib/cuke_linter/linters/test_with_setup_step_as_final_step_linter.rb +33 -33
- data/lib/cuke_linter/linters/test_with_too_many_steps_linter.rb +27 -27
- data/lib/cuke_linter/version.rb +4 -4
- data/lib/cuke_linter.rb +196 -196
- data/testing/cucumber/features/command_line.feature +202 -202
- data/testing/cucumber/features/configuration/configuring_linters.feature +58 -58
- data/testing/cucumber/features/configuration/locally_scoping_linters.feature +55 -55
- data/testing/cucumber/features/configuration/using_configurations.feature +41 -41
- data/testing/cucumber/features/custom_linters.feature +56 -56
- data/testing/cucumber/features/default_linters.feature +57 -57
- data/testing/cucumber/features/formatters/pretty_formatter.feature +26 -26
- data/testing/cucumber/features/linters/background_does_more_than_setup.feature +84 -84
- data/testing/cucumber/features/linters/element_with_common_tags.feature +28 -28
- data/testing/cucumber/features/linters/element_with_duplicate_tags.feature +71 -71
- data/testing/cucumber/features/linters/element_with_too_many_tags.feature +70 -70
- data/testing/cucumber/features/linters/example_without_name.feature +34 -34
- data/testing/cucumber/features/linters/feature_file_with_invalid_name.feature +20 -20
- data/testing/cucumber/features/linters/feature_file_with_mismatched_name.feature +32 -32
- data/testing/cucumber/features/linters/feature_with_too_many_different_tags.feature +56 -56
- data/testing/cucumber/features/linters/feature_without_description.feature +17 -17
- data/testing/cucumber/features/linters/feature_without_name.feature +18 -18
- data/testing/cucumber/features/linters/feature_without_scenarios.feature +39 -39
- data/testing/cucumber/features/linters/outline_with_single_example_row.feature +23 -23
- data/testing/cucumber/features/linters/single_test_background.feature +24 -24
- data/testing/cucumber/features/linters/step_too_long.feature +43 -43
- data/testing/cucumber/features/linters/step_with_end_period.feature +21 -21
- data/testing/cucumber/features/linters/test_name_too_long.feature +41 -41
- data/testing/cucumber/features/linters/test_should_use_background.feature +29 -29
- data/testing/cucumber/features/linters/test_with_action_as_final_step.feature +50 -50
- data/testing/cucumber/features/linters/test_with_bad_name.feature +29 -29
- data/testing/cucumber/features/linters/test_with_no_action_step.feature +56 -56
- data/testing/cucumber/features/linters/test_with_no_name.feature +23 -23
- data/testing/cucumber/features/linters/test_with_no_verification_step.feature +58 -58
- data/testing/cucumber/features/linters/test_with_setup_step_after_action_step.feature +57 -57
- data/testing/cucumber/features/linters/test_with_setup_step_after_verification_step.feature +57 -57
- data/testing/cucumber/features/linters/test_with_setup_step_as_final_step.feature +50 -50
- data/testing/cucumber/features/linters/test_with_too_many_steps.feature +61 -61
- metadata +21 -25
- data/testing/cucumber/features/linters/rule_without_name.feature +0 -18
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
Feature: Test with too many steps linter
|
|
2
|
-
|
|
3
|
-
As a reader of documentation
|
|
4
|
-
I want scenarios and outlines to not have an excessive number of steps
|
|
5
|
-
So that I can fit it all in my head at once
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Scenario: Linting
|
|
9
|
-
|
|
10
|
-
Note: Also works on outlines
|
|
11
|
-
|
|
12
|
-
Given a linter for tests with too many steps
|
|
13
|
-
And the following feature:
|
|
14
|
-
"""
|
|
15
|
-
Feature:
|
|
16
|
-
|
|
17
|
-
Scenario:
|
|
18
|
-
* step 1
|
|
19
|
-
* step 2
|
|
20
|
-
* step 3
|
|
21
|
-
* step 4
|
|
22
|
-
* step 5
|
|
23
|
-
* step 6
|
|
24
|
-
* step 7
|
|
25
|
-
* step 8
|
|
26
|
-
* step 9
|
|
27
|
-
* step 10
|
|
28
|
-
* step one too many...
|
|
29
|
-
"""
|
|
30
|
-
When it is linted
|
|
31
|
-
Then an error is reported:
|
|
32
|
-
| linter | problem | location |
|
|
33
|
-
| TestWithTooManyStepsLinter | Test has too many steps. 11 steps found (max 10). | <path_to_file>:3 |
|
|
34
|
-
|
|
35
|
-
Scenario: Configuration of step count threshold
|
|
36
|
-
Given a linter for tests with too many steps has been registered
|
|
37
|
-
And the following configuration file:
|
|
38
|
-
"""
|
|
39
|
-
TestWithTooManyStepsLinter:
|
|
40
|
-
StepThreshold: 3
|
|
41
|
-
"""
|
|
42
|
-
And the following feature:
|
|
43
|
-
"""
|
|
44
|
-
Feature:
|
|
45
|
-
|
|
46
|
-
Scenario:
|
|
47
|
-
* step 1
|
|
48
|
-
* step 2
|
|
49
|
-
* step 3
|
|
50
|
-
* step one too many...
|
|
51
|
-
"""
|
|
52
|
-
When the configuration file is loaded
|
|
53
|
-
And the feature is linted
|
|
54
|
-
Then an error is reported:
|
|
55
|
-
| linter | problem | location |
|
|
56
|
-
| TestWithTooManyStepsLinter | Test has too many steps. 4 steps found (max 3). | <path_to_file>:3 |
|
|
57
|
-
|
|
58
|
-
@wip
|
|
59
|
-
Scenario: Configuration
|
|
60
|
-
|
|
61
|
-
Ideas: Configure whether or not the linter includes steps from backgrounds
|
|
1
|
+
Feature: Test with too many steps linter
|
|
2
|
+
|
|
3
|
+
As a reader of documentation
|
|
4
|
+
I want scenarios and outlines to not have an excessive number of steps
|
|
5
|
+
So that I can fit it all in my head at once
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Scenario: Linting
|
|
9
|
+
|
|
10
|
+
Note: Also works on outlines
|
|
11
|
+
|
|
12
|
+
Given a linter for tests with too many steps
|
|
13
|
+
And the following feature:
|
|
14
|
+
"""
|
|
15
|
+
Feature:
|
|
16
|
+
|
|
17
|
+
Scenario:
|
|
18
|
+
* step 1
|
|
19
|
+
* step 2
|
|
20
|
+
* step 3
|
|
21
|
+
* step 4
|
|
22
|
+
* step 5
|
|
23
|
+
* step 6
|
|
24
|
+
* step 7
|
|
25
|
+
* step 8
|
|
26
|
+
* step 9
|
|
27
|
+
* step 10
|
|
28
|
+
* step one too many...
|
|
29
|
+
"""
|
|
30
|
+
When it is linted
|
|
31
|
+
Then an error is reported:
|
|
32
|
+
| linter | problem | location |
|
|
33
|
+
| TestWithTooManyStepsLinter | Test has too many steps. 11 steps found (max 10). | <path_to_file>:3 |
|
|
34
|
+
|
|
35
|
+
Scenario: Configuration of step count threshold
|
|
36
|
+
Given a linter for tests with too many steps has been registered
|
|
37
|
+
And the following configuration file:
|
|
38
|
+
"""
|
|
39
|
+
TestWithTooManyStepsLinter:
|
|
40
|
+
StepThreshold: 3
|
|
41
|
+
"""
|
|
42
|
+
And the following feature:
|
|
43
|
+
"""
|
|
44
|
+
Feature:
|
|
45
|
+
|
|
46
|
+
Scenario:
|
|
47
|
+
* step 1
|
|
48
|
+
* step 2
|
|
49
|
+
* step 3
|
|
50
|
+
* step one too many...
|
|
51
|
+
"""
|
|
52
|
+
When the configuration file is loaded
|
|
53
|
+
And the feature is linted
|
|
54
|
+
Then an error is reported:
|
|
55
|
+
| linter | problem | location |
|
|
56
|
+
| TestWithTooManyStepsLinter | Test has too many steps. 4 steps found (max 3). | <path_to_file>:3 |
|
|
57
|
+
|
|
58
|
+
@wip
|
|
59
|
+
Scenario: Configuration
|
|
60
|
+
|
|
61
|
+
Ideas: Configure whether or not the linter includes steps from backgrounds
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cuke_linter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eric Kessler
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: cuke_modeler
|
|
@@ -36,42 +35,42 @@ dependencies:
|
|
|
36
35
|
requirements:
|
|
37
36
|
- - "<"
|
|
38
37
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '
|
|
38
|
+
version: '5.0'
|
|
40
39
|
type: :development
|
|
41
40
|
prerelease: false
|
|
42
41
|
version_requirements: !ruby/object:Gem::Requirement
|
|
43
42
|
requirements:
|
|
44
43
|
- - "<"
|
|
45
44
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '
|
|
45
|
+
version: '5.0'
|
|
47
46
|
- !ruby/object:Gem::Dependency
|
|
48
47
|
name: childprocess
|
|
49
48
|
requirement: !ruby/object:Gem::Requirement
|
|
50
49
|
requirements:
|
|
51
50
|
- - "<"
|
|
52
51
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: '
|
|
52
|
+
version: '6.0'
|
|
54
53
|
type: :development
|
|
55
54
|
prerelease: false
|
|
56
55
|
version_requirements: !ruby/object:Gem::Requirement
|
|
57
56
|
requirements:
|
|
58
57
|
- - "<"
|
|
59
58
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: '
|
|
59
|
+
version: '6.0'
|
|
61
60
|
- !ruby/object:Gem::Dependency
|
|
62
61
|
name: cucumber
|
|
63
62
|
requirement: !ruby/object:Gem::Requirement
|
|
64
63
|
requirements:
|
|
65
64
|
- - "<"
|
|
66
65
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: '
|
|
66
|
+
version: '11.0'
|
|
68
67
|
type: :development
|
|
69
68
|
prerelease: false
|
|
70
69
|
version_requirements: !ruby/object:Gem::Requirement
|
|
71
70
|
requirements:
|
|
72
71
|
- - "<"
|
|
73
72
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: '
|
|
73
|
+
version: '11.0'
|
|
75
74
|
- !ruby/object:Gem::Dependency
|
|
76
75
|
name: cuke_slicer
|
|
77
76
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -81,7 +80,7 @@ dependencies:
|
|
|
81
80
|
version: 2.0.2
|
|
82
81
|
- - "<"
|
|
83
82
|
- !ruby/object:Gem::Version
|
|
84
|
-
version: '
|
|
83
|
+
version: '4.0'
|
|
85
84
|
type: :development
|
|
86
85
|
prerelease: false
|
|
87
86
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -91,7 +90,7 @@ dependencies:
|
|
|
91
90
|
version: 2.0.2
|
|
92
91
|
- - "<"
|
|
93
92
|
- !ruby/object:Gem::Version
|
|
94
|
-
version: '
|
|
93
|
+
version: '4.0'
|
|
95
94
|
- !ruby/object:Gem::Dependency
|
|
96
95
|
name: ffi
|
|
97
96
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -138,16 +137,16 @@ dependencies:
|
|
|
138
137
|
name: rake
|
|
139
138
|
requirement: !ruby/object:Gem::Requirement
|
|
140
139
|
requirements:
|
|
141
|
-
- - "
|
|
140
|
+
- - "<"
|
|
142
141
|
- !ruby/object:Gem::Version
|
|
143
|
-
version: '
|
|
142
|
+
version: '14.0'
|
|
144
143
|
type: :development
|
|
145
144
|
prerelease: false
|
|
146
145
|
version_requirements: !ruby/object:Gem::Requirement
|
|
147
146
|
requirements:
|
|
148
|
-
- - "
|
|
147
|
+
- - "<"
|
|
149
148
|
- !ruby/object:Gem::Version
|
|
150
|
-
version: '
|
|
149
|
+
version: '14.0'
|
|
151
150
|
- !ruby/object:Gem::Dependency
|
|
152
151
|
name: require_all
|
|
153
152
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -180,16 +179,16 @@ dependencies:
|
|
|
180
179
|
name: rubocop
|
|
181
180
|
requirement: !ruby/object:Gem::Requirement
|
|
182
181
|
requirements:
|
|
183
|
-
- - "
|
|
182
|
+
- - "<"
|
|
184
183
|
- !ruby/object:Gem::Version
|
|
185
|
-
version: 0
|
|
184
|
+
version: '2.0'
|
|
186
185
|
type: :development
|
|
187
186
|
prerelease: false
|
|
188
187
|
version_requirements: !ruby/object:Gem::Requirement
|
|
189
188
|
requirements:
|
|
190
|
-
- - "
|
|
189
|
+
- - "<"
|
|
191
190
|
- !ruby/object:Gem::Version
|
|
192
|
-
version: 0
|
|
191
|
+
version: '2.0'
|
|
193
192
|
- !ruby/object:Gem::Dependency
|
|
194
193
|
name: simplecov
|
|
195
194
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -300,7 +299,6 @@ files:
|
|
|
300
299
|
- testing/cucumber/features/linters/feature_without_name.feature
|
|
301
300
|
- testing/cucumber/features/linters/feature_without_scenarios.feature
|
|
302
301
|
- testing/cucumber/features/linters/outline_with_single_example_row.feature
|
|
303
|
-
- testing/cucumber/features/linters/rule_without_name.feature
|
|
304
302
|
- testing/cucumber/features/linters/single_test_background.feature
|
|
305
303
|
- testing/cucumber/features/linters/step_too_long.feature
|
|
306
304
|
- testing/cucumber/features/linters/step_with_end_period.feature
|
|
@@ -322,9 +320,8 @@ metadata:
|
|
|
322
320
|
bug_tracker_uri: https://github.com/enkessler/cuke_linter/issues
|
|
323
321
|
changelog_uri: https://github.com/enkessler/cuke_linter/blob/master/CHANGELOG.md
|
|
324
322
|
documentation_uri: https://www.rubydoc.info/gems/cuke_linter
|
|
325
|
-
homepage_uri: https://github.com/enkessler/cuke_linter
|
|
326
323
|
source_code_uri: https://github.com/enkessler/cuke_linter
|
|
327
|
-
|
|
324
|
+
rubygems_mfa_required: 'true'
|
|
328
325
|
rdoc_options: []
|
|
329
326
|
require_paths:
|
|
330
327
|
- lib
|
|
@@ -335,15 +332,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
335
332
|
version: '2.1'
|
|
336
333
|
- - "<"
|
|
337
334
|
- !ruby/object:Gem::Version
|
|
338
|
-
version: '
|
|
335
|
+
version: '5.0'
|
|
339
336
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
340
337
|
requirements:
|
|
341
338
|
- - ">="
|
|
342
339
|
- !ruby/object:Gem::Version
|
|
343
340
|
version: '0'
|
|
344
341
|
requirements: []
|
|
345
|
-
rubygems_version:
|
|
346
|
-
signing_key:
|
|
342
|
+
rubygems_version: 4.0.3
|
|
347
343
|
specification_version: 4
|
|
348
344
|
summary: Lints feature files used by Cucumber and other similar frameworks.
|
|
349
345
|
test_files: []
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Feature: Feature without name linter
|
|
2
|
-
|
|
3
|
-
As a reader of documentation
|
|
4
|
-
I want every feature to have a name
|
|
5
|
-
So that I can get an idea of what the feature is about without having to read every use case
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Scenario: Linting
|
|
9
|
-
Given a linter for features without a name
|
|
10
|
-
And the following feature:
|
|
11
|
-
"""
|
|
12
|
-
Feature:
|
|
13
|
-
This feature does not have a name
|
|
14
|
-
"""
|
|
15
|
-
When it is linted
|
|
16
|
-
Then an error is reported:
|
|
17
|
-
| linter | problem | location |
|
|
18
|
-
| FeatureWithoutNameLinter | Feature does not have a name. | <path_to_file>:1 |
|