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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55e2f43b28308b30833c2b07a91ae28e8074c6d6
|
4
|
+
data.tar.gz: 6a3c3f5df11ae6f61fc79a50c03a53a3838aeeb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4e3dd19a9559351279e7765618324381513d88e807e7e12f8de3ee8278190641833881432a50d20df19adc6d0358a2641beb874c085df8b24064f0aa5ea1c60
|
7
|
+
data.tar.gz: 94cbc13a038fefa351f0e18ca93fdd783135f2a15d31d1afdfc86c8f5368098c4395492450394fa2e284e59a2017c2492ac83f82914503abe87a99e5e4254ac4
|
data/Rakefile
CHANGED
@@ -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
@@ -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
|
+
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-
|
11
|
+
date: 2016-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gherkin
|