gherkin_lint 0.3.0 → 0.3.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.
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.0.gem'
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'gherkin_lint'
3
- s.version = '0.3.0'
3
+ s.version = '0.3.1'
4
4
  s.date = '2016-05-01'
5
5
  s.summary = 'Gherkin Lint'
6
6
  s.description = 'Lint Gherkin Files'
@@ -106,7 +106,7 @@ module GherkinLint
106
106
  end
107
107
 
108
108
  def lint
109
- fail 'not implemented'
109
+ raise 'not implemented'
110
110
  end
111
111
 
112
112
  def reference(file, feature = nil, scenario = nil, step = nil)
@@ -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.length < 1
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'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gherkin_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: