gherkin_language 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -3
- data/Rakefile +1 -1
- data/features/sentences.feature +31 -0
- data/gherkin_language.gemspec +2 -2
- data/lib/gherkin_language.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81c9bc84bfd759e138af42fc5badda27881e0392
|
4
|
+
data.tar.gz: 875f612c67a66184c6b6b6654ee556642d3a843f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c58c13eacf296ed1d23a9826535cfef0cfdbb6e8d79d9383e59ad026404a254d6c3c04c9ba6e833d24992ee923c23e7f534e8ca3c450786df396b0ea449e9c23
|
7
|
+
data.tar.gz: 90e86a9d251f6d3c8b053b01223c846ebde6e620e30a3c03be3792a402d204394d7a591c5f90461f1c2a3a34b7c8a05f8756852892706d40ded949f8412bb432
|
data/.rubocop.yml
CHANGED
@@ -7,12 +7,12 @@
|
|
7
7
|
|
8
8
|
# Offense count: 5
|
9
9
|
Metrics/AbcSize:
|
10
|
-
Max:
|
10
|
+
Max: 48
|
11
11
|
|
12
12
|
# Offense count: 2
|
13
13
|
# Configuration parameters: CountComments.
|
14
14
|
Metrics/ClassLength:
|
15
|
-
Max:
|
15
|
+
Max: 161
|
16
16
|
|
17
17
|
# Offense count: 2
|
18
18
|
Metrics/CyclomaticComplexity:
|
@@ -26,7 +26,7 @@ Metrics/LineLength:
|
|
26
26
|
# Offense count: 8
|
27
27
|
# Configuration parameters: CountComments.
|
28
28
|
Metrics/MethodLength:
|
29
|
-
Max:
|
29
|
+
Max: 38
|
30
30
|
|
31
31
|
# Offense count: 1
|
32
32
|
# Configuration parameters: CountKeywordArgs.
|
data/Rakefile
CHANGED
data/features/sentences.feature
CHANGED
@@ -75,6 +75,37 @@ Feature: Sentences
|
|
75
75
|
Given 2 when 4 then 6
|
76
76
|
"""
|
77
77
|
|
78
|
+
Scenario: Extract Sentences from outlines with multiple examples
|
79
|
+
Given a file named "test.feature" with:
|
80
|
+
"""
|
81
|
+
Feature: Test
|
82
|
+
Scenario Outline: Test
|
83
|
+
When <A> <B>
|
84
|
+
Then <C>
|
85
|
+
|
86
|
+
Examples: Table
|
87
|
+
| A |
|
88
|
+
| 1 |
|
89
|
+
| 2 |
|
90
|
+
|
91
|
+
Examples: Second Table
|
92
|
+
| B | C |
|
93
|
+
| 3 | 5 |
|
94
|
+
| 4 | 6 |
|
95
|
+
"""
|
96
|
+
When I run `ruby extract_sentences.rb`
|
97
|
+
Then it should pass with:
|
98
|
+
"""
|
99
|
+
Test
|
100
|
+
Test
|
101
|
+
Table
|
102
|
+
Second Table
|
103
|
+
When 1 3 then 5
|
104
|
+
When 1 4 then 6
|
105
|
+
When 2 3 then 5
|
106
|
+
When 2 4 then 6
|
107
|
+
"""
|
108
|
+
|
78
109
|
Scenario: Extract Sentences considers feature description
|
79
110
|
Given a file named "test.feature" with:
|
80
111
|
"""
|
data/gherkin_language.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'gherkin_language'
|
3
|
-
s.version = '0.0.
|
4
|
-
s.date = '2015-07-
|
3
|
+
s.version = '0.0.6'
|
4
|
+
s.date = '2015-07-19'
|
5
5
|
s.summary = 'Gherkin Language'
|
6
6
|
s.description = 'Check language of Gherkin Files'
|
7
7
|
s.authors = ['Stefan Rohe']
|
data/lib/gherkin_language.rb
CHANGED
@@ -303,12 +303,13 @@ class GherkinLanguage
|
|
303
303
|
end
|
304
304
|
sentence = terms.join ' '
|
305
305
|
if scenario.key? 'examples'
|
306
|
-
|
306
|
+
prototypes = [sentence.strip]
|
307
307
|
scenario['examples'].each do |example|
|
308
308
|
sentences.push example['name'] unless example['name'].empty?
|
309
309
|
sentences.push example['description'] unless example['description'].empty?
|
310
|
-
|
310
|
+
prototypes = prototypes.map { |prototype| expand_outlines(prototype, example) }.flatten
|
311
311
|
end
|
312
|
+
sentences += prototypes
|
312
313
|
else
|
313
314
|
sentences.push sentence.strip
|
314
315
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gherkin_language
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Rohe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gherkin
|