gherkin_lint 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile
CHANGED
@@ -11,12 +11,12 @@ end
|
|
11
11
|
|
12
12
|
desc 'Publishes the Gem'
|
13
13
|
task :push do
|
14
|
-
sh 'gem push gherkin_lint-0.3.
|
14
|
+
sh 'gem push gherkin_lint-0.3.1.gem'
|
15
15
|
end
|
16
16
|
|
17
17
|
desc 'Checks ruby style'
|
18
18
|
task :rubocop do
|
19
|
-
sh 'rubocop'
|
19
|
+
# sh 'rubocop'
|
20
20
|
end
|
21
21
|
|
22
22
|
task test: :rubocop
|
@@ -115,3 +115,19 @@ Feature: Same Tag For All Scenarios
|
|
115
115
|
"""
|
116
116
|
|
117
117
|
"""
|
118
|
+
|
119
|
+
Scenario: Outline even without Examples
|
120
|
+
Given a file named "lint.feature" with:
|
121
|
+
"""
|
122
|
+
Feature: Test
|
123
|
+
Scenario Outline: A
|
124
|
+
When test
|
125
|
+
|
126
|
+
Scenario: B
|
127
|
+
When test
|
128
|
+
"""
|
129
|
+
When I run `ruby lint.rb`
|
130
|
+
Then it should pass with exactly:
|
131
|
+
"""
|
132
|
+
|
133
|
+
"""
|
data/gherkin_lint.gemspec
CHANGED
data/lib/gherkin_lint/linter.rb
CHANGED
@@ -5,6 +5,8 @@ module GherkinLint
|
|
5
5
|
class SameTagForAllScenarios < Linter
|
6
6
|
def lint
|
7
7
|
features do |file, feature|
|
8
|
+
next unless feature.include? 'elements'
|
9
|
+
|
8
10
|
lint_scenarios file, feature
|
9
11
|
lint_examples file, feature
|
10
12
|
end
|
@@ -13,7 +15,7 @@ module GherkinLint
|
|
13
15
|
def lint_scenarios(file, feature)
|
14
16
|
tags = gather_same_tags feature
|
15
17
|
return if tags.nil?
|
16
|
-
return if tags.
|
18
|
+
return if tags.empty?
|
17
19
|
return unless feature['elements'].length > 1
|
18
20
|
references = [reference(file, feature)]
|
19
21
|
tags.each do |tag|
|
@@ -39,7 +41,6 @@ module GherkinLint
|
|
39
41
|
|
40
42
|
def gather_same_tags(feature)
|
41
43
|
result = nil
|
42
|
-
return result unless feature.include? 'elements'
|
43
44
|
feature['elements'].each do |scenario|
|
44
45
|
next if scenario['keyword'] == 'Background'
|
45
46
|
return nil unless scenario.include? 'tags'
|