chutney 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/chutney.gemspec +1 -1
- data/docs/usage/rules.md +4 -1
- data/lib/chutney/linter.rb +5 -2
- data/lib/chutney/linter/file_name_differs_feature_name.rb +1 -1
- data/lib/chutney/linter/missing_feature_description.rb +2 -0
- data/lib/chutney/linter/missing_feature_name.rb +2 -0
- data/lib/chutney/linter/same_tag_for_all_scenarios.rb +2 -2
- data/lib/chutney/linter/too_many_different_tags.rb +1 -1
- data/lib/chutney/linter/use_outline.rb +1 -1
- data/lib/chutney/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2da8d4d9f8b99fbedf8ed3b2407e5ec9024496258f86cd69fb76d35699b4ffa4
|
4
|
+
data.tar.gz: 1821ce09b96bc45203e1a65abac9d5c042bca5036933feda9c066c0ff852ede6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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/).
|
data/chutney.gemspec
CHANGED
@@ -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.
|
58
|
+
spec.add_development_dependency 'rubocop', '~> 0.89.0'
|
59
59
|
spec.add_development_dependency 'rspec', '~> 3.8'
|
60
60
|
|
61
61
|
end
|
data/docs/usage/rules.md
CHANGED
@@ -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
|
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.
|
data/lib/chutney/linter.rb
CHANGED
@@ -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
|
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
|
8
|
-
lint_examples if feature
|
7
|
+
lint_scenarios if feature&.include?(:children)
|
8
|
+
lint_examples if feature&.include?(:children)
|
9
9
|
end
|
10
10
|
|
11
11
|
def lint_scenarios
|
@@ -36,7 +36,7 @@ module Chutney
|
|
36
36
|
|
37
37
|
def gather_scenarios(feature)
|
38
38
|
scenarios = []
|
39
|
-
return scenarios
|
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
|
data/lib/chutney/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|
183
|
+
version: 0.89.0
|
184
184
|
- !ruby/object:Gem::Dependency
|
185
185
|
name: rspec
|
186
186
|
requirement: !ruby/object:Gem::Requirement
|