chutney 2.1.0 → 2.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b678f90aea391f8707bda58ec5e2f6caf9b5d1f1bf5b1503c6862d4023d5f18
4
- data.tar.gz: ecb2e762fa06c882869ff007e80261137816f431a78c07257d2f140e8f8f6f78
3
+ metadata.gz: 2da8d4d9f8b99fbedf8ed3b2407e5ec9024496258f86cd69fb76d35699b4ffa4
4
+ data.tar.gz: 1821ce09b96bc45203e1a65abac9d5c042bca5036933feda9c066c0ff852ede6
5
5
  SHA512:
6
- metadata.gz: 5f1f5c793a5d0080320606d56471f8ebcb7b0c3ceedca3e5e492eb877d1f0582aef997cd686c9e4782afeff407fb0346a0acbee288bca7306b39f2d8dc951540
7
- data.tar.gz: 362d6bf5c6a1cb8c14a005534259e0ad5592df046a6dc3f747562b0b1875ee22e19b2076ff60873ca54967e2bd2188513566c36d0433ccd1c886fbc73b5c71ab
6
+ metadata.gz: 3adad450052c2008c3a1db8f82e65893c39605592b72ce676e9b3973fd19f6f2812a949ac5fa375909277298c12115e94771b7dcee06b34dc09362f415af16da
7
+ data.tar.gz: ebb9e4d1ea6842131863666ea4362dfc3e94c50525b1444c75e5f8b662c3bd340481d4a8bb00b265991dec0546aab0017e3f86d3a76a850738fbf4407cc68d32
data/README.md CHANGED
@@ -12,10 +12,11 @@
12
12
  <div align="center">
13
13
 
14
14
  [![Gem Version](https://badge.fury.io/rb/chutney.svg)](https://badge.fury.io/rb/chutney)
15
+ [![Downloads](https://img.shields.io/gem/dt/chutney)](https://rubygems.org/gems/chutney)
15
16
  ![CircleCI branch](https://img.shields.io/circleci/project/github/BillyRuffian/chutney/master.svg?style=flat-square)
16
17
  [![CodeFactor](https://www.codefactor.io/repository/github/billyruffian/chutney/badge?style=flat-square)](https://www.codefactor.io/repository/github/billyruffian/chutney)
17
18
  ![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/BillyRuffian/chutney.svg?style=flat-square)
18
19
 
19
20
  </div>
20
21
 
21
- Read the documentation [here](https://billyruffian.github.io/chutney/).
22
+ Read the documentation [here](https://billyruffian.github.io/chutney/).
@@ -55,7 +55,7 @@ Gem::Specification.new do |spec|
55
55
  spec.add_development_dependency 'rake', '~> 13.0'
56
56
  spec.add_development_dependency 'rerun', '~> 0.13'
57
57
  spec.add_development_dependency 'rspec-expectations', '~> 3.0'
58
- spec.add_development_dependency 'rubocop', '~> 0.85.1'
58
+ spec.add_development_dependency 'rubocop', '~> 0.89.0'
59
59
  spec.add_development_dependency 'rspec', '~> 3.8'
60
60
 
61
61
  end
@@ -18,6 +18,9 @@ Chutney enforces its rules with the linters. These are:
18
18
  [AvoidScripting](https://github.com/BillyRuffian/chutney/blob/master/features/avoid_scripting.feature)
19
19
  : You have a lot of steps, are you sure you're not scripting the scenario when you should be specifying the behaviour of the system?
20
20
 
21
+ [AvoidTypographersQuotes](https://github.com/BillyRuffian/chutney/blob/master/features/avoid_typographers_quotes.feature)
22
+ : Cutting and pasting from Word documents? Is that pasting in curly-quotes instead of neutral ones you would type on a keyboard? Are you sure that's what you want?
23
+
21
24
  [BackgroundDoesMoreThanSetup](https://github.com/BillyRuffian/chutney/blob/master/features/background_does_more_than_setup.feature)
22
25
  : Background in feature files should only do setup activity and so they should only contain `Given` steps.
23
26
 
@@ -76,7 +79,7 @@ Chutney enforces its rules with the linters. These are:
76
79
  : This is a very long step. Consider writing it more concisely.
77
80
 
78
81
  [TooManyDifferentTags](https://github.com/BillyRuffian/chutney/blob/master/features/too_many_different_tags.feature)
79
- : This feature has a lot of differnt tags.
82
+ : This feature has a lot of different tags.
80
83
 
81
84
  [TooManySteps](https://github.com/BillyRuffian/chutney/blob/master/features/too_many_steps.feature)
82
85
  : This feature has a lot of steps. Consider writing it more concisely.
@@ -1,4 +1,5 @@
1
1
  # gherkin utilities
2
+
2
3
  module Chutney
3
4
  # base class for all linters
4
5
  class Linter
@@ -102,7 +103,9 @@ module Chutney
102
103
  end
103
104
  end
104
105
 
105
- def elements
106
+ def elements
107
+ return [] unless feature
108
+
106
109
  if block_given?
107
110
  feature[:children].each do |child|
108
111
  next if off_switch?(child)
@@ -113,7 +116,7 @@ module Chutney
113
116
  feature[:children]
114
117
  end
115
118
  end
116
-
119
+
117
120
  def off_switch?(element = feature)
118
121
  off_switch = element[:tags]
119
122
  .then { |tags| tags || [] }
@@ -2,7 +2,7 @@ module Chutney
2
2
  # service class to lint for file name differs feature name
3
3
  class FileNameDiffersFeatureName < Linter
4
4
  def lint
5
- return unless feature.include? :name
5
+ return unless feature&.include?(:name)
6
6
 
7
7
  expected_feature_name = title_case(filename)
8
8
  return if ignore_whitespaces(feature[:name]).casecmp(ignore_whitespaces(expected_feature_name)) == 0
@@ -3,6 +3,8 @@ module Chutney
3
3
  class MissingFeatureDescription < Linter
4
4
  MESSAGE = 'Features should have a description so that its purpose is clear'.freeze
5
5
  def lint
6
+ return unless feature
7
+
6
8
  name = feature.key?(:description) ? feature[:description].strip : ''
7
9
  add_issue(I18n.t('linters.missing_feature_description'), feature) if name.empty?
8
10
  end
@@ -2,6 +2,8 @@ module Chutney
2
2
  # service class to lint for missing feature names
3
3
  class MissingFeatureName < Linter
4
4
  def lint
5
+ return unless feature
6
+
5
7
  name = feature.key?(:name) ? feature[:name].strip : ''
6
8
  add_issue(I18n.t('linters.missing_feature_name'), feature) if name.empty?
7
9
  end
@@ -4,8 +4,8 @@ module Chutney
4
4
  # service class to lint for using same tag on all scenarios
5
5
  class SameTagForAllScenarios < Linter
6
6
  def lint
7
- lint_scenarios if feature.include? :children
8
- lint_examples if feature.include? :children
7
+ lint_scenarios if feature&.include?(:children)
8
+ lint_examples if feature&.include?(:children)
9
9
  end
10
10
 
11
11
  def lint_scenarios
@@ -16,7 +16,7 @@ module Chutney
16
16
  end
17
17
 
18
18
  def all_tags
19
- return [] unless feature.include?(:children)
19
+ return [] unless feature&.include?(:children)
20
20
 
21
21
  tags_for(feature) + feature[:children].map { |scenario| tags_for(scenario) }.flatten
22
22
  end
@@ -36,7 +36,7 @@ module Chutney
36
36
 
37
37
  def gather_scenarios(feature)
38
38
  scenarios = []
39
- return scenarios unless feature.include? :children
39
+ return scenarios if feature.nil? || !feature.include?(:children)
40
40
 
41
41
  feature[:children].each do |scenario|
42
42
  next unless scenario[:type] == :Scenario
@@ -1,3 +1,3 @@
1
1
  module Chutney
2
- VERSION = '2.1.0'.freeze
2
+ VERSION = '2.1.1'.freeze
3
3
  end
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: 2.1.0
4
+ version: 2.1.1
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: 2020-07-17 00:00:00.000000000 Z
14
+ date: 2020-08-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: amatch
@@ -173,14 +173,14 @@ dependencies:
173
173
  requirements:
174
174
  - - "~>"
175
175
  - !ruby/object:Gem::Version
176
- version: 0.85.1
176
+ version: 0.89.0
177
177
  type: :development
178
178
  prerelease: false
179
179
  version_requirements: !ruby/object:Gem::Requirement
180
180
  requirements:
181
181
  - - "~>"
182
182
  - !ruby/object:Gem::Version
183
- version: 0.85.1
183
+ version: 0.89.0
184
184
  - !ruby/object:Gem::Dependency
185
185
  name: rspec
186
186
  requirement: !ruby/object:Gem::Requirement