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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df497ba41442ba3e1383ea34dc77b22426c944c4
4
- data.tar.gz: 71863c28b770c160a5b4305fe49464301322a699
3
+ metadata.gz: 81c9bc84bfd759e138af42fc5badda27881e0392
4
+ data.tar.gz: 875f612c67a66184c6b6b6654ee556642d3a843f
5
5
  SHA512:
6
- metadata.gz: 99d3b6e7c5b529424aeb7fb686305453626db0a1440304dc1fad6309cb28185627f6c79d3049f749f32d518e272cbb98f59fb9369a27fbc9f8c4218ca4f4295c
7
- data.tar.gz: 182cb1b7d69f7b0d7141535da8fd12f3b6c224e0041a8f32f3d7f1d0e326c18f1581476e540cb3afe9d5a5ab2bfced1cff580e9969817795f6a5c0f76bfe3bea
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: 47
10
+ Max: 48
11
11
 
12
12
  # Offense count: 2
13
13
  # Configuration parameters: CountComments.
14
14
  Metrics/ClassLength:
15
- Max: 159
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: 36
29
+ Max: 38
30
30
 
31
31
  # Offense count: 1
32
32
  # Configuration parameters: CountKeywordArgs.
data/Rakefile CHANGED
@@ -18,7 +18,7 @@ task test: :cucumber
18
18
 
19
19
  desc 'Publishes the Gem'
20
20
  task :push do
21
- sh 'gem push gherkin_language-0.0.5.gem'
21
+ sh 'gem push gherkin_language-0.0.6.gem'
22
22
  end
23
23
 
24
24
  desc 'Checks ruby style'
@@ -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
  """
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'gherkin_language'
3
- s.version = '0.0.5'
4
- s.date = '2015-07-12'
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']
@@ -303,12 +303,13 @@ class GherkinLanguage
303
303
  end
304
304
  sentence = terms.join ' '
305
305
  if scenario.key? 'examples'
306
- # TODO: support for multiple examples?
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
- expand_outlines(sentence.strip, example).map { |expanded| sentences.push expanded }
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.5
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-12 00:00:00.000000000 Z
11
+ date: 2015-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gherkin