cucumber_lint 0.0.4 → 0.1.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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/Gemfile +2 -1
  4. data/Gemfile.lock +48 -30
  5. data/README.md +41 -24
  6. data/Rakefile +1 -1
  7. data/circle.yml +3 -0
  8. data/config/default.yml +27 -0
  9. data/cucumber_lint.gemspec +4 -4
  10. data/features/cucumber_lint/consistent_empty_lines/between_description_and_scenario.feature +39 -0
  11. data/features/cucumber_lint/consistent_empty_lines/between_elements/ending_with_docstring.feature +47 -0
  12. data/features/cucumber_lint/consistent_empty_lines/between_elements/ending_with_examples.feature +49 -0
  13. data/features/cucumber_lint/consistent_empty_lines/between_elements/ending_with_step.feature +41 -0
  14. data/features/cucumber_lint/consistent_empty_lines/between_elements/ending_with_table.feature +43 -0
  15. data/features/cucumber_lint/consistent_empty_lines/between_feature_and_description.feature +33 -0
  16. data/features/cucumber_lint/consistent_empty_lines/between_feature_and_scenario.feature +33 -0
  17. data/features/cucumber_lint/consistent_table_headers/examples_table.feature +74 -0
  18. data/features/cucumber_lint/consistent_table_headers/step_table.feature +64 -0
  19. data/features/cucumber_lint/consistent_table_headers/unsupported_style.feature +20 -0
  20. data/features/cucumber_lint/consistent_table_whitespace/examples_table.feature +46 -0
  21. data/features/cucumber_lint/consistent_table_whitespace/step_table.feature +42 -0
  22. data/features/cucumber_lint/no_empty_features.feature +20 -0
  23. data/features/cucumber_lint/no_files.feature +6 -0
  24. data/features/cucumber_lint/no_repeating_keywords.feature +44 -0
  25. data/features/cucumber_lint/unsupported_options.feature +11 -0
  26. data/features/step_definitions/cli_steps.rb +47 -10
  27. data/features/step_definitions/env.rb +5 -9
  28. data/features/step_definitions/fixtures/config/disabled.yml +18 -0
  29. data/features/step_definitions/support/file_helpers.rb +20 -0
  30. data/lib/core_ext/array.rb +8 -0
  31. data/lib/core_ext/basic_object.rb +8 -0
  32. data/lib/core_ext/hash.rb +3 -18
  33. data/lib/core_ext/string.rb +7 -0
  34. data/lib/cucumber_lint/cli.rb +60 -31
  35. data/lib/cucumber_lint/config.rb +55 -0
  36. data/lib/cucumber_lint/errors/unsupported_style.rb +10 -0
  37. data/lib/cucumber_lint/linted_file.rb +77 -0
  38. data/lib/cucumber_lint/linter/feature_empty_lines_linter.rb +125 -0
  39. data/lib/cucumber_lint/linter/feature_linter.rb +33 -30
  40. data/lib/cucumber_lint/linter/scenario_outline_linter.rb +17 -8
  41. data/lib/cucumber_lint/linter/steps_linter.rb +9 -8
  42. data/lib/cucumber_lint/linter/table_linter.rb +26 -15
  43. data/lib/cucumber_lint/linter.rb +10 -10
  44. data/lib/cucumber_lint/version.rb +1 -1
  45. data/lib/cucumber_lint.rb +4 -1
  46. metadata +35 -36
  47. data/.travis.yml +0 -9
  48. data/features/cucumber_lint/fix/nothing.feature +0 -12
  49. data/features/cucumber_lint/fix/repeating_steps.feature +0 -25
  50. data/features/cucumber_lint/fix/table_whitespace.feature +0 -25
  51. data/features/cucumber_lint/fix/uppercase_table_headers.feature +0 -25
  52. data/features/cucumber_lint/lint/nothing.feature +0 -12
  53. data/features/cucumber_lint/lint/repeating_steps.feature +0 -31
  54. data/features/cucumber_lint/lint/table_whitespace.feature +0 -27
  55. data/features/cucumber_lint/lint/uppercase_table_headers.feature +0 -30
  56. data/features/step_definitions/feature_formatter_steps.rb +0 -15
  57. data/features/step_definitions/fixtures/repeating_steps/bad.feature.example +0 -12
  58. data/features/step_definitions/fixtures/repeating_steps/good.feature.example +0 -12
  59. data/features/step_definitions/fixtures/table_whitespace/bad.feature.example +0 -20
  60. data/features/step_definitions/fixtures/table_whitespace/good.feature.example +0 -20
  61. data/features/step_definitions/fixtures/uppercase_table_headers/bad.feature.example +0 -20
  62. data/features/step_definitions/fixtures/uppercase_table_headers/good.feature.example +0 -20
  63. data/lib/cucumber_lint/fix_list.rb +0 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59f628a63c86ef172e490dc170991ddef1985a98
4
- data.tar.gz: e2d61829e08b5a7401c2956a10835600f9ea9721
3
+ metadata.gz: 4e04abaad578b72d7df4b49529bcdeceb3da0b0f
4
+ data.tar.gz: a13968b903cbf742e4a7d98b75c04900fb0859fa
5
5
  SHA512:
6
- metadata.gz: f447e200f24df005c46b2a9902e40372e9f1e0b2b17d5f34a88fa1ac51b6f87383412f8023a9bcdc553193321b34c801c62c04b8187c8251fc174f701d8da52e
7
- data.tar.gz: 8a7e79e55b286855daff422796482af173d987a2fe84c29b7d0b570aecf692414cbe5238bf0a576a93892f1548688a6826a17a65b0c2379e6f79cab927597742
6
+ metadata.gz: 831b6e7a3ef209caaa4c105dc9a079348a1c5fe7ddf59717c8811b2bf0d257654e9f1fc30941e4da263f5d4779873128b9ce77a51e67f120cd70d1765ca9d994
7
+ data.tar.gz: 22d26718f94e44ce99862b29c6ab7a30e194ed055210c5fb882dbc3af970befdf26c9f1a99a7c0ef4f47ff548f857e1b7c70ff82309bc335c199974fd12a27ae
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.2
data/Gemfile CHANGED
@@ -1,10 +1,11 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- ruby '2.2.0'
3
+ ruby '2.2.2'
4
4
 
5
5
  gemspec
6
6
 
7
7
  group :development do
8
+ gem 'activesupport'
8
9
  gem 'cucumber'
9
10
  gem 'open4'
10
11
  gem 'rake'
data/Gemfile.lock CHANGED
@@ -2,64 +2,82 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  cucumber_lint (0.0.4)
5
- colorize (~> 0.7.5)
6
- gherkin (~> 2.12.2, >= 2.12.2)
7
- multi_json (~> 1.10.1, >= 1.10.1)
5
+ colorize (~> 0.7.7)
6
+ gherkin (~> 2.12.2)
7
+ multi_json (~> 1.11.2)
8
8
 
9
9
  GEM
10
10
  remote: http://rubygems.org/
11
11
  specs:
12
- ast (2.0.0)
13
- astrolabe (1.3.0)
14
- parser (>= 2.2.0.pre.3, < 3.0)
12
+ activesupport (4.2.4)
13
+ i18n (~> 0.7)
14
+ json (~> 1.7, >= 1.7.7)
15
+ minitest (~> 5.1)
16
+ thread_safe (~> 0.3, >= 0.3.4)
17
+ tzinfo (~> 1.1)
18
+ ast (2.1.0)
19
+ astrolabe (1.3.1)
20
+ parser (~> 2.2)
15
21
  builder (3.2.2)
16
- colorize (0.7.5)
17
- cucumber (1.3.18)
22
+ colorize (0.7.7)
23
+ cucumber (2.0.2)
18
24
  builder (>= 2.1.2)
25
+ cucumber-core (~> 1.2.0)
19
26
  diff-lcs (>= 1.1.3)
20
27
  gherkin (~> 2.12)
21
28
  multi_json (>= 1.7.5, < 2.0)
22
- multi_test (>= 0.1.1)
29
+ multi_test (>= 0.1.2)
30
+ cucumber-core (1.2.0)
31
+ gherkin (~> 2.12.0)
23
32
  diff-lcs (1.2.5)
24
33
  gherkin (2.12.2)
25
34
  multi_json (~> 1.3)
26
- multi_json (1.10.1)
27
- multi_test (0.1.1)
35
+ i18n (0.7.0)
36
+ json (1.8.3)
37
+ minitest (5.8.0)
38
+ multi_json (1.11.2)
39
+ multi_test (0.1.2)
28
40
  open4 (1.3.4)
29
- parser (2.2.0.1)
41
+ parser (2.2.2.6)
30
42
  ast (>= 1.1, < 3.0)
31
- slop (~> 3.4, >= 3.4.5)
32
- powerpack (0.0.9)
43
+ powerpack (0.1.1)
33
44
  rainbow (2.0.0)
34
45
  rake (10.4.2)
35
- rspec (3.1.0)
36
- rspec-core (~> 3.1.0)
37
- rspec-expectations (~> 3.1.0)
38
- rspec-mocks (~> 3.1.0)
39
- rspec-core (3.1.7)
40
- rspec-support (~> 3.1.0)
41
- rspec-expectations (3.1.2)
46
+ rspec (3.3.0)
47
+ rspec-core (~> 3.3.0)
48
+ rspec-expectations (~> 3.3.0)
49
+ rspec-mocks (~> 3.3.0)
50
+ rspec-core (3.3.2)
51
+ rspec-support (~> 3.3.0)
52
+ rspec-expectations (3.3.1)
42
53
  diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.1.0)
44
- rspec-mocks (3.1.3)
45
- rspec-support (~> 3.1.0)
46
- rspec-support (3.1.2)
47
- rubocop (0.28.0)
54
+ rspec-support (~> 3.3.0)
55
+ rspec-mocks (3.3.2)
56
+ diff-lcs (>= 1.2.0, < 2.0)
57
+ rspec-support (~> 3.3.0)
58
+ rspec-support (3.3.0)
59
+ rubocop (0.33.0)
48
60
  astrolabe (~> 1.3)
49
- parser (>= 2.2.0.pre.7, < 3.0)
50
- powerpack (~> 0.0.6)
61
+ parser (>= 2.2.2.5, < 3.0)
62
+ powerpack (~> 0.1)
51
63
  rainbow (>= 1.99.1, < 3.0)
52
64
  ruby-progressbar (~> 1.4)
53
- ruby-progressbar (1.7.1)
54
- slop (3.6.0)
65
+ ruby-progressbar (1.7.5)
66
+ thread_safe (0.3.5)
67
+ tzinfo (1.2.2)
68
+ thread_safe (~> 0.1)
55
69
 
56
70
  PLATFORMS
57
71
  ruby
58
72
 
59
73
  DEPENDENCIES
74
+ activesupport
60
75
  cucumber
61
76
  cucumber_lint!
62
77
  open4
63
78
  rake
64
79
  rspec
65
80
  rubocop
81
+
82
+ BUNDLED WITH
83
+ 1.10.6
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # cucumber_lint
2
2
  [![Gem Version](https://badge.fury.io/rb/cucumber_lint.svg)](http://badge.fury.io/rb/cucumber_lint)
3
- [![Build Status](https://travis-ci.org/charlierudolph/cucumber_lint.svg)](https://travis-ci.org/charlierudolph/cucumber_lint)
3
+ [![Build Status](https://travis-ci.org/charlierudolph/cucumber_lint.svg?branch=master)](https://travis-ci.org/charlierudolph/cucumber_lint)
4
4
  [![Dependency Status](https://gemnasium.com/charlierudolph/cucumber_lint.svg)](https://gemnasium.com/charlierudolph/cucumber_lint)
5
5
  [![Code Climate](https://codeclimate.com/github/charlierudolph/cucumber_lint/badges/gpa.svg)](https://codeclimate.com/github/charlierudolph/cucumber_lint)
6
6
 
@@ -19,32 +19,49 @@ cucumber_lint # Lints (exits with status 1 on failure, 0 on success)
19
19
  cucumber_lint --fix # Fixes all lint errors
20
20
  ```
21
21
 
22
- ### Features
22
+ ### Configuration
23
23
 
24
- #### Repeating step keywords
25
- * Use `And` instead of repeating `Given`, `When`, or `Then`
24
+ Create a `cucumber_lint.yml` file in the same folder that contains your `features` directory.
25
+ Override the [default config](./config/default.yml) to disable a rule or change the enforced style.
26
26
 
27
- ```coffee
28
- # Bad # Good
29
- Given A Given A
30
- Given B And B
31
- When C When C
32
- Then D Then D
33
- Then E And E
34
- ```
27
+ ### Rules
35
28
 
36
- #### Table whitespace
37
- * requires leading and trailing space around the cell content
38
- * requires pipes to be aligned
29
+ ##### consistent_empty_lines
30
+ * requires empty lines to be used consistently throughout features
39
31
 
40
32
 
41
- ```coffee
42
- # Bad # Bad # Good
43
- |VEGETABLE|CODENAME| | VEGETABLE | CODENAME | | VEGETABLE | CODENAME |
44
- |Asparagus|Alpha| |Asparagus | Alpha | | Asparagus | Alpha |
45
- |Broccoli|Bravo| |Broccoli | Bravo | | Broccoli | Bravo |
46
- |Carrot|Charlie| | Carrot| Charlie | | Carrot | Charlie |
47
- ```
33
+ ##### consistent_table_headers
34
+ * requires all table headers to have the same style
35
+ * supported styles: uppercase and lowercase
36
+ * scenario outline placeholders must share the same style
37
+
38
+
39
+ ##### consistent_table_whitespace
40
+ * requires leading and trailing space around the cell content and the pipes to be aligned
41
+
42
+
43
+ ```coffee
44
+ # Bad # Bad # Good
45
+ |VEGETABLE|CODENAME| | VEGETABLE | CODENAME | | VEGETABLE | CODENAME |
46
+ |Asparagus|Alpha| |Asparagus | Alpha | | Asparagus | Alpha |
47
+ |Broccoli|Bravo| |Broccoli | Bravo | | Broccoli | Bravo |
48
+ |Carrot|Charlie| | Carrot| Charlie | | Carrot | Charlie |
49
+ ```
50
+
51
+ ##### no_empty_features
52
+ * empty `.feature` files are not allowed
53
+
54
+
55
+ ##### no_repeating_keywords
56
+ * Use `And` instead of repeating `Given`, `When`, or `Then`
57
+
48
58
 
49
- #### Table headers and scenario outline placeholders
50
- * required to be uppercase
59
+ ```coffee
60
+ # Bad # Good
61
+ Given A Given A
62
+ Given B And B
63
+ When C When C
64
+ When D And D
65
+ Then E Then E
66
+ Then F And F
67
+ ```
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ end
20
20
 
21
21
  desc 'Run features'
22
22
  task :features do
23
- sh 'bundle exec cucumber'
23
+ sh 'bundle exec cucumber -f progress'
24
24
  end
25
25
 
26
26
 
data/circle.yml ADDED
@@ -0,0 +1,3 @@
1
+ test:
2
+ override:
3
+ - bundle exec rake
@@ -0,0 +1,27 @@
1
+ consistent_empty_lines:
2
+ enabled: true
3
+ between_description_and_element: 1
4
+ between_elements: 1
5
+ between_feature_and_description: 0
6
+ between_feature_and_element: 1
7
+ between_scenario_outline_and_examples: 1
8
+
9
+
10
+ consistent_table_headers:
11
+ enabled: true
12
+ enforced_style: uppercase
13
+ supported_styles:
14
+ - lowercase # column header
15
+ - uppercase # COLUMN HEADER
16
+
17
+
18
+ consistent_table_whitespace:
19
+ enabled: true
20
+
21
+
22
+ no_empty_features:
23
+ enabled: true
24
+
25
+
26
+ no_repeating_keywords:
27
+ enabled: true
@@ -12,11 +12,11 @@ Gem::Specification.new do |spec|
12
12
  spec.homepage = 'https://github.com/charlierudolph/cucumber_lint'
13
13
  spec.license = 'MIT'
14
14
 
15
- spec.add_runtime_dependency 'colorize', '~> 0.7.5'
16
- spec.add_runtime_dependency 'gherkin', '~> 2.12.2', '>= 2.12.2'
17
- spec.add_runtime_dependency 'multi_json', '~> 1.10.1', '>= 1.10.1'
15
+ spec.add_runtime_dependency 'colorize', '~> 0.7.7'
16
+ spec.add_runtime_dependency 'gherkin', '~> 2.12.2'
17
+ spec.add_runtime_dependency 'multi_json', '~> 1.11.2'
18
18
 
19
19
  spec.files = `git ls-files`.split("\n")
20
- spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
20
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ['lib']
22
22
  end
@@ -0,0 +1,39 @@
1
+ Feature: consistent_empty_lines between description and scenario
2
+
3
+ Background:
4
+ Given I have a feature with content
5
+ """
6
+ Feature: Test Feature
7
+ As a user
8
+ When I have this
9
+ I expect that
10
+ Scenario: Test Scenario
11
+ Given this
12
+ Then that
13
+ """
14
+
15
+ Scenario: disabled
16
+ Given I have "consistent_empty_lines" disabled
17
+ When I run `cucumber_lint`
18
+ Then it passes
19
+
20
+ Scenario: lint and fix
21
+ Given I have "consistent_empty_lines" enabled with "between_description_and_scenario" as "1"
22
+ When I run `cucumber_lint`
23
+ Then it fails with
24
+ | LINE | MESSAGE |
25
+ | 5 | Add empty line |
26
+ When I run `cucumber_lint --fix`
27
+ Then my feature now has content
28
+ """
29
+ Feature: Test Feature
30
+ As a user
31
+ When I have this
32
+ I expect that
33
+
34
+ Scenario: Test Scenario
35
+ Given this
36
+ Then that
37
+ """
38
+ When I run `cucumber_lint`
39
+ Then it passes
@@ -0,0 +1,47 @@
1
+ Feature: consistent_empty_lines between elements (ending with docstring)
2
+
3
+ Background:
4
+ Given I have a feature with content
5
+ """
6
+ Feature: Test Feature
7
+
8
+ Scenario: Test Scenario
9
+ Given this
10
+ Then that
11
+ \"\"\"
12
+ string
13
+ \"\"\"
14
+ Scenario: Test Scenario
15
+ Given this
16
+ Then that
17
+ """
18
+
19
+ Scenario: disabled
20
+ Given I have "consistent_empty_lines" disabled
21
+ When I run `cucumber_lint`
22
+ Then it passes
23
+
24
+ Scenario: lint and fix
25
+ Given I have "consistent_empty_lines" enabled with "between_elements" as "1"
26
+ When I run `cucumber_lint`
27
+ Then it fails with
28
+ | LINE | MESSAGE |
29
+ | 9 | Add empty line |
30
+ When I run `cucumber_lint --fix`
31
+ Then my feature now has content
32
+ """
33
+ Feature: Test Feature
34
+
35
+ Scenario: Test Scenario
36
+ Given this
37
+ Then that
38
+ \"\"\"
39
+ string
40
+ \"\"\"
41
+
42
+ Scenario: Test Scenario
43
+ Given this
44
+ Then that
45
+ """
46
+ When I run `cucumber_lint`
47
+ Then it passes
@@ -0,0 +1,49 @@
1
+ Feature: consistent_empty_lines between elements (ending with examples)
2
+
3
+ Background:
4
+ Given I have a feature with content
5
+ """
6
+ Feature: Test Feature
7
+
8
+ Scenario Outline: Test Scenario Outline
9
+ Given <a>
10
+ Then <b>
11
+
12
+ Examples:
13
+ | a | b |
14
+ | this | that |
15
+ Scenario: Test Scenario
16
+ Given this
17
+ Then that
18
+ """
19
+
20
+ Scenario: disabled
21
+ Given I have "consistent_empty_lines" disabled
22
+ When I run `cucumber_lint`
23
+ Then it passes
24
+
25
+ Scenario: lint and fix
26
+ Given I have "consistent_empty_lines" enabled with "between_elements" as "1"
27
+ When I run `cucumber_lint`
28
+ Then it fails with
29
+ | LINE | MESSAGE |
30
+ | 10 | Add empty line |
31
+ When I run `cucumber_lint --fix`
32
+ Then my feature now has content
33
+ """
34
+ Feature: Test Feature
35
+
36
+ Scenario Outline: Test Scenario Outline
37
+ Given <a>
38
+ Then <b>
39
+
40
+ Examples:
41
+ | a | b |
42
+ | this | that |
43
+
44
+ Scenario: Test Scenario
45
+ Given this
46
+ Then that
47
+ """
48
+ When I run `cucumber_lint`
49
+ Then it passes
@@ -0,0 +1,41 @@
1
+ Feature: consistent_empty_lines between elements (ending with step)
2
+
3
+ Background:
4
+ Given I have a feature with content
5
+ """
6
+ Feature: Test Feature
7
+
8
+ Scenario: Test Scenario
9
+ Given this
10
+ Then that
11
+ Scenario: Test Scenario
12
+ Given this
13
+ Then that
14
+ """
15
+
16
+ Scenario: disabled
17
+ Given I have "consistent_empty_lines" disabled
18
+ When I run `cucumber_lint`
19
+ Then it passes
20
+
21
+ Scenario: lint and fix
22
+ Given I have "consistent_empty_lines" enabled with "between_elements" as "1"
23
+ When I run `cucumber_lint`
24
+ Then it fails with
25
+ | LINE | MESSAGE |
26
+ | 6 | Add empty line |
27
+ When I run `cucumber_lint --fix`
28
+ Then my feature now has content
29
+ """
30
+ Feature: Test Feature
31
+
32
+ Scenario: Test Scenario
33
+ Given this
34
+ Then that
35
+
36
+ Scenario: Test Scenario
37
+ Given this
38
+ Then that
39
+ """
40
+ When I run `cucumber_lint`
41
+ Then it passes
@@ -0,0 +1,43 @@
1
+ Feature: consistent_empty_lines between elements (ending with table)
2
+
3
+ Background:
4
+ Given I have a feature with content
5
+ """
6
+ Feature: Test Feature
7
+
8
+ Scenario: Test Scenario
9
+ Given this
10
+ Then that
11
+ | table |
12
+ Scenario: Test Scenario
13
+ Given this
14
+ Then that
15
+ """
16
+
17
+ Scenario: disabled
18
+ Given I have "consistent_empty_lines" disabled
19
+ When I run `cucumber_lint`
20
+ Then it passes
21
+
22
+ Scenario: lint and fix
23
+ Given I have "consistent_empty_lines" enabled with "elements" as "1"
24
+ When I run `cucumber_lint`
25
+ Then it fails with
26
+ | LINE | MESSAGE |
27
+ | 7 | Add empty line |
28
+ When I run `cucumber_lint --fix`
29
+ Then my feature now has content
30
+ """
31
+ Feature: Test Feature
32
+
33
+ Scenario: Test Scenario
34
+ Given this
35
+ Then that
36
+ | table |
37
+
38
+ Scenario: Test Scenario
39
+ Given this
40
+ Then that
41
+ """
42
+ When I run `cucumber_lint`
43
+ Then it passes
@@ -0,0 +1,33 @@
1
+ Feature: consistent_empty_lines between feature and description
2
+
3
+ Background:
4
+ Given I have a feature with content
5
+ """
6
+ Feature: Test Feature
7
+
8
+ As a user
9
+ When I have this
10
+ I expect that
11
+ """
12
+
13
+ Scenario: disabled
14
+ Given I have "consistent_empty_lines" disabled
15
+ When I run `cucumber_lint`
16
+ Then it passes
17
+
18
+ Scenario: lint and fix
19
+ Given I have "consistent_empty_lines" enabled with "feature_and_description" as "1"
20
+ When I run `cucumber_lint`
21
+ Then it fails with
22
+ | LINE | MESSAGE |
23
+ | 2 | Remove empty line |
24
+ When I run `cucumber_lint --fix`
25
+ Then my feature now has content
26
+ """
27
+ Feature: Test Feature
28
+ As a user
29
+ When I have this
30
+ I expect that
31
+ """
32
+ When I run `cucumber_lint`
33
+ Then it passes
@@ -0,0 +1,33 @@
1
+ Feature: consistent_empty_lines between feature and scenario
2
+
3
+ Background:
4
+ Given I have a feature with content
5
+ """
6
+ Feature: Test Feature
7
+ Scenario: Test Scenario
8
+ Given this
9
+ Then that
10
+ """
11
+
12
+ Scenario: disabled
13
+ Given I have "consistent_empty_lines" disabled
14
+ When I run `cucumber_lint`
15
+ Then it passes
16
+
17
+ Scenario: lint and fix
18
+ Given I have "consistent_empty_lines" enabled with "between_feature_and_description" as "1"
19
+ When I run `cucumber_lint`
20
+ Then it fails with
21
+ | LINE | MESSAGE |
22
+ | 2 | Add empty line |
23
+ When I run `cucumber_lint --fix`
24
+ Then my feature now has content
25
+ """
26
+ Feature: Test Feature
27
+
28
+ Scenario: Test Scenario
29
+ Given this
30
+ Then that
31
+ """
32
+ When I run `cucumber_lint`
33
+ Then it passes
@@ -0,0 +1,74 @@
1
+ Feature: consistent_table_headers for an examples table
2
+
3
+ Background:
4
+ Given I have a feature with content
5
+ """
6
+ Feature: Test Feature
7
+
8
+ Scenario Outline: Test Scenario Outline
9
+ Given <VEGETABLE> and <fruit>
10
+ Then I expect <Code Name>
11
+
12
+ Examples:
13
+ | VEGETABLE | fruit | Code Name |
14
+ | Asparagus | Apple | Alpha |
15
+ | Broccoli | Banana | Bravo |
16
+ | Carrot | Cherry | Charlie |
17
+ """
18
+
19
+ Scenario: disabled
20
+ Given I have "consistent_table_headers" disabled
21
+ When I run `cucumber_lint`
22
+ Then it passes
23
+
24
+ Scenario: uppercase - lint and fix
25
+ Given I have "consistent_table_headers" enabled with "enforced_style" as "uppercase"
26
+ When I run `cucumber_lint`
27
+ Then it fails with
28
+ | LINE | MESSAGE |
29
+ | 4 | uppercase "<fruit>" |
30
+ | 5 | uppercase "<Code Name>" |
31
+ | 8 | uppercase table headers |
32
+ When I run `cucumber_lint --fix`
33
+ Then my feature now has content
34
+ """
35
+ Feature: Test Feature
36
+
37
+ Scenario Outline: Test Scenario Outline
38
+ Given <VEGETABLE> and <FRUIT>
39
+ Then I expect <CODE NAME>
40
+
41
+ Examples:
42
+ | VEGETABLE | FRUIT | CODE NAME |
43
+ | Asparagus | Apple | Alpha |
44
+ | Broccoli | Banana | Bravo |
45
+ | Carrot | Cherry | Charlie |
46
+ """
47
+ When I run `cucumber_lint`
48
+ Then it passes
49
+
50
+ Scenario: lowercase - lint and fix
51
+ Given I have "consistent_table_headers" enabled with "enforced_style" as "lowercase"
52
+ When I run `cucumber_lint`
53
+ Then it fails with
54
+ | LINE | MESSAGE |
55
+ | 4 | lowercase "<VEGETABLE>" |
56
+ | 5 | lowercase "<Code Name>" |
57
+ | 8 | lowercase table headers |
58
+ When I run `cucumber_lint --fix`
59
+ Then my feature now has content
60
+ """
61
+ Feature: Test Feature
62
+
63
+ Scenario Outline: Test Scenario Outline
64
+ Given <vegetable> and <fruit>
65
+ Then I expect <code name>
66
+
67
+ Examples:
68
+ | vegetable | fruit | code name |
69
+ | Asparagus | Apple | Alpha |
70
+ | Broccoli | Banana | Bravo |
71
+ | Carrot | Cherry | Charlie |
72
+ """
73
+ When I run `cucumber_lint`
74
+ Then it passes