chutney 3.3.0 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6725cb1d8360b6cf746da8362a04e4e1e1795ee21d70876d39ff08e230ffd0dd
4
- data.tar.gz: ad0cc926afdacbdcd8853866073102f0796f0cd3338b02f5ff5bdc69060c2724
3
+ metadata.gz: 72a8913c71a8e2291fa14ef87b527e11481dfe45519370455fbddf2df8856836
4
+ data.tar.gz: cd4fded7ea629dd5ae5e5b74ac204c8b5d3dfee96e21f65db3c3355449dbb0c1
5
5
  SHA512:
6
- metadata.gz: a36c2f5da40c1672b77dbbc836a4db6cccf7f445547303aae8e85392ab7b84daba918c8d0343eb73c4683f42c0fce03ebbaf4500a2690878a1fe4fdb5fe0385a
7
- data.tar.gz: 5a51f02edf59cee68d71855263cdc7692d6132c8eddeb5f97f8d1e3d0512a08e1533457f6545abf6f737dada8c36f81a83d29d6cea15a8c6f4c198a51a7c5728
6
+ metadata.gz: 2387b637bdb751865c8f6fbc97f61e90e25f7d6dc52f6da7dae598f5d156c06226f985df609b3a58597213f7e9b6e5a87be2fd5c67c78b57ae60c16603cde040
7
+ data.tar.gz: b7d67216485f10777e91250582facc4143e0f463360463f87aa8bf219e16b91e8e000a4e8ae94f442130f5246d0adf61e4df0b50b22bea1a05743145ea77e346
data/chutney.gemspec CHANGED
@@ -61,7 +61,7 @@ Gem::Specification.new do |spec|
61
61
  spec.add_development_dependency 'rake', '~> 13.0'
62
62
  spec.add_development_dependency 'rerun', '~> 0.13'
63
63
  spec.add_development_dependency 'rspec-expectations', '~> 3.0'
64
- spec.add_development_dependency 'rubocop', '~> 1.32.0'
64
+ spec.add_development_dependency 'rubocop', '~> 1.45.1'
65
65
  spec.add_development_dependency 'rspec', '~> 3.8'
66
66
 
67
67
  spec.required_ruby_version = '>= 2.6'
@@ -24,12 +24,16 @@ GivensAfterBackground:
24
24
  Enabled: true
25
25
  MissingExampleName:
26
26
  Enabled: true
27
+ MissingExampleTable:
28
+ Enabled: true
27
29
  MissingFeatureDescription:
28
30
  Enabled: true
29
31
  MissingFeatureName:
30
32
  Enabled: true
31
33
  MissingScenarioName:
32
34
  Enabled: true
35
+ MissingScenarioOutline:
36
+ Enabled: true
33
37
  MissingTestAction:
34
38
  Enabled: true
35
39
  MissingVerification:
data/docs/usage/rules.md CHANGED
@@ -39,12 +39,16 @@ Chutney enforces its rules with the linters. These are:
39
39
 
40
40
  [MissingExampleName](https://github.com/BillyRuffian/chutney/blob/master/features/missing_example_name.feature): If you have more than one example table in your scenario, they should each be given unique names.
41
41
 
42
+ [MissingExampleTable](https://github.com/BillyRuffian/chutney/blob/master/features/missing_example_table.feature): You are missing an example table. You should have at least one example table when using Scenario outlines.
43
+
42
44
  [MissingFeatureDescription](https://github.com/BillyRuffian/chutney/blob/master/features/missing_feature_description.feature): Your feature should have a value statement. These are usually in the form 'As a... I want.. So that...'.
43
45
 
44
46
  [MissingFeatureName](https://github.com/BillyRuffian/chutney/blob/master/features/missing_feature_name.feature): You should give your features a descriptive name.
45
47
 
46
48
  [MissingScenarioName](https://github.com/BillyRuffian/chutney/blob/master/features/missing_scenario_name.feature): You should name your scenarios and scenario outlines.
47
49
 
50
+ [MissingScenarioOutline](https://github.com/BillyRuffian/chutney/blob/master/features/missing_scenario_outline.feature): You should use Scenario Outline instead of Scenario when there is an Examples table to indicate that this scenario will be run multiple times with different data.
51
+
48
52
  [MissingTestAction](https://github.com/BillyRuffian/chutney/blob/master/features/missing_test_action.feature): You don't have an action (a `When` step) in your scenario.
49
53
 
50
54
  [MissingVerification](https://github.com/BillyRuffian/chutney/blob/master/features/missing_verification.feature): You don't have a verification step (a `Then` step) in your scenario.
@@ -9,6 +9,7 @@ module Chutney
9
9
  next unless scenario.examples
10
10
 
11
11
  next if scenario.examples.length > 1
12
+ next if scenario.examples.first.nil? # dont run lint if the example does not exist
12
13
  next if scenario.examples.first.rows.length > 2 # first row is the header
13
14
 
14
15
  add_issue(I18n.t('linters.avoid_outline_for_single_example'), feature, scenario)
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'chutney/linter'
4
+
5
+ module Chutney
6
+ # service class to lint for missing example tables in scenario outlines
7
+ class MissingExampleTable < Linter
8
+ def lint
9
+ scenarios do |_feature, scenario|
10
+ next unless scenario.is_a? CukeModeler::Outline
11
+ next unless scenario.examples.empty?
12
+
13
+ add_issue(I18n.t('linters.missing_example_table'), feature, scenario)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'chutney/linter'
4
+
5
+ module Chutney
6
+ # service class to lint for missing scenario outlines when examples tables given
7
+ class MissingScenarioOutline < Linter
8
+ def lint
9
+ scenarios do |_feature, scenario|
10
+ next unless scenario.is_a? CukeModeler::Outline
11
+ next unless scenario.keyword == 'Scenario'
12
+
13
+ add_issue(I18n.t('linters.missing_scenario_outline'), feature, scenario)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chutney
4
- VERSION = '3.3.0'
4
+ VERSION = '3.5.0'
5
5
  end
data/lib/chutney.rb CHANGED
@@ -19,9 +19,11 @@ require 'chutney/linter/givens_after_background'
19
19
  require 'chutney/linter/invalid_file_name'
20
20
  require 'chutney/linter/invalid_step_flow'
21
21
  require 'chutney/linter/missing_example_name'
22
+ require 'chutney/linter/missing_example_table'
22
23
  require 'chutney/linter/missing_feature_description'
23
24
  require 'chutney/linter/missing_feature_name'
24
25
  require 'chutney/linter/missing_scenario_name'
26
+ require 'chutney/linter/missing_scenario_outline'
25
27
  require 'chutney/linter/missing_test_action'
26
28
  require 'chutney/linter/missing_verification'
27
29
  require 'chutney/linter/required_tags_starts_with'
@@ -49,6 +49,8 @@ en:
49
49
  You have a scenerio with more than one example table, at least one of which is
50
50
  unnamed or has a duplicate name.
51
51
  You should give your example tables clear and meaningful names when you have more than one.
52
+ missing_example_table: >-
53
+ Scenario Outline must have at least one Examples table.
52
54
  missing_feature_description: >-
53
55
  Features should have a description / value statement so that the importance of the feature
54
56
  is well understood.
@@ -56,6 +58,8 @@ en:
56
58
  This feature is unnamed. You should name all features.
57
59
  missing_scenario_name: >-
58
60
  This scenario is unnamed. You should name all scenarios.
61
+ missing_scenario_outline: >-
62
+ Scenario Outline should be used instead of Scenario when there is an Examples table.
59
63
  missing_test_action: >-
60
64
  Your test has no action step. All scenarios should have a 'When' step indicating the
61
65
  action being taken.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chutney
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nigel Brookes-Thomas
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2022-08-26 00:00:00.000000000 Z
14
+ date: 2023-02-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: amatch
@@ -179,14 +179,14 @@ dependencies:
179
179
  requirements:
180
180
  - - "~>"
181
181
  - !ruby/object:Gem::Version
182
- version: 1.32.0
182
+ version: 1.45.1
183
183
  type: :development
184
184
  prerelease: false
185
185
  version_requirements: !ruby/object:Gem::Requirement
186
186
  requirements:
187
187
  - - "~>"
188
188
  - !ruby/object:Gem::Version
189
- version: 1.32.0
189
+ version: 1.45.1
190
190
  - !ruby/object:Gem::Dependency
191
191
  name: rspec
192
192
  requirement: !ruby/object:Gem::Requirement
@@ -265,9 +265,11 @@ files:
265
265
  - lib/chutney/linter/invalid_file_name.rb
266
266
  - lib/chutney/linter/invalid_step_flow.rb
267
267
  - lib/chutney/linter/missing_example_name.rb
268
+ - lib/chutney/linter/missing_example_table.rb
268
269
  - lib/chutney/linter/missing_feature_description.rb
269
270
  - lib/chutney/linter/missing_feature_name.rb
270
271
  - lib/chutney/linter/missing_scenario_name.rb
272
+ - lib/chutney/linter/missing_scenario_outline.rb
271
273
  - lib/chutney/linter/missing_test_action.rb
272
274
  - lib/chutney/linter/missing_verification.rb
273
275
  - lib/chutney/linter/required_tags_starts_with.rb
@@ -312,7 +314,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
312
314
  - !ruby/object:Gem::Version
313
315
  version: '0'
314
316
  requirements: []
315
- rubygems_version: 3.3.7
317
+ rubygems_version: 3.4.1
316
318
  signing_key:
317
319
  specification_version: 4
318
320
  summary: A linter for multi-lingual Gherkin