gherkin_lint 0.4.4 → 0.5.0

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
  SHA1:
3
- metadata.gz: 1ac684644e64056647d7275076f8e3a0f10ecca7
4
- data.tar.gz: 13e1811141a72ebf8104b26d8e785f68abdea622
3
+ metadata.gz: 55e2f43b28308b30833c2b07a91ae28e8074c6d6
4
+ data.tar.gz: 6a3c3f5df11ae6f61fc79a50c03a53a3838aeeb2
5
5
  SHA512:
6
- metadata.gz: 4ff74d05a8b2dfbf93f4a72fbb95269532c1586746c0e4d52f085cf55b8bc3eb982a49e365b1485ff207fc824fe260d6e34721c16a3e095eac9c468208dd5771
7
- data.tar.gz: 4917c9a786357cdd568242e225edd0254dcad767e26f9fe146b93a17726a4eefa8e61e05e25815f11d245adc954c63eed09a184a79f74844dc932af0886bb471
6
+ metadata.gz: e4e3dd19a9559351279e7765618324381513d88e807e7e12f8de3ee8278190641833881432a50d20df19adc6d0358a2641beb874c085df8b24064f0aa5ea1c60
7
+ data.tar.gz: 94cbc13a038fefa351f0e18ca93fdd783135f2a15d31d1afdfc86c8f5368098c4395492450394fa2e284e59a2017c2492ac83f82914503abe87a99e5e4254ac4
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ end
11
11
 
12
12
  desc 'Publishes the Gem'
13
13
  task :push do
14
- sh 'gem push gherkin_lint-0.4.4.gem'
14
+ sh 'gem push gherkin_lint-0.5.0.gem'
15
15
  end
16
16
 
17
17
  desc 'Checks ruby style'
@@ -45,3 +45,31 @@ Feature: File Name Differs Feature Name
45
45
  | lint |
46
46
  | Lint |
47
47
  | LINT |
48
+
49
+ Scenario Outline: Valid Example for Snake Case
50
+ Given a file named "lint.rb" with:
51
+ """
52
+ $LOAD_PATH << '../../lib'
53
+ require 'gherkin_lint'
54
+
55
+ linter = GherkinLint::GherkinLint.new
56
+ linter.enable %w(FileNameDiffersFeatureName)
57
+ linter.analyze 'lint_test.feature'
58
+ exit linter.report
59
+
60
+ """
61
+ Given a file named "lint_test.feature" with:
62
+ """
63
+ Feature: <name>
64
+ """
65
+ When I run `ruby lint.rb lint_test.feature`
66
+ Then it should pass with exactly:
67
+ """
68
+
69
+ """
70
+
71
+ Examples: Valid Names
72
+ | name |
73
+ | lint_test |
74
+ | lint-test |
75
+ | lint test |
data/gherkin_lint.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'gherkin_lint'
3
- s.version = '0.4.4'
4
- s.date = '2016-08-30'
3
+ s.version = '0.5.0'
4
+ s.date = '2016-08-31'
5
5
  s.summary = 'Gherkin Lint'
6
6
  s.description = 'Lint Gherkin Files'
7
7
  s.authors = ['Stefan Rohe']
@@ -7,7 +7,7 @@ module GherkinLint
7
7
  features do |file, feature|
8
8
  next unless feature.include? :name
9
9
  expected_feature_name = title_case file
10
- next if feature[:name].casecmp(expected_feature_name) == 0
10
+ next if ignore_whitespaces(feature[:name]).casecmp(ignore_whitespaces(expected_feature_name)) == 0
11
11
  references = [reference(file, feature)]
12
12
  add_error(references, "Feature name should be '#{expected_feature_name}'")
13
13
  end
@@ -17,5 +17,9 @@ module GherkinLint
17
17
  value = File.basename(value, '.feature')
18
18
  value.split('_').collect(&:capitalize).join(' ')
19
19
  end
20
+
21
+ def ignore_whitespaces(value)
22
+ value.delete('-').delete('_').delete(' ')
23
+ end
20
24
  end
21
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gherkin_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Rohe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-30 00:00:00.000000000 Z
11
+ date: 2016-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gherkin