gherkin-ruby 0.2.0 → 0.2.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/gherkin-ruby.gemspec +1 -1
- data/lib/gherkin/ast.rb +1 -0
- data/lib/gherkin/parser/gherkin.y +3 -3
- data/lib/gherkin/parser/parser.rb +15 -5
- data/lib/gherkin/version.rb +1 -1
- data/test/gherkin/parser_test.rb +4 -0
- metadata +3 -3
data/gherkin-ruby.gemspec
CHANGED
data/lib/gherkin/ast.rb
CHANGED
@@ -40,7 +40,7 @@ rule
|
|
40
40
|
FeatureName { result = val[0] }
|
41
41
|
| FeatureName Newline { result = val[0] }
|
42
42
|
| FeatureName Newline
|
43
|
-
Description { result = val[0] }
|
43
|
+
Description { result = val[0]; result.description = val[2] }
|
44
44
|
;
|
45
45
|
|
46
46
|
FeatureName:
|
@@ -49,8 +49,8 @@ rule
|
|
49
49
|
;
|
50
50
|
|
51
51
|
Description:
|
52
|
-
TEXT Newline
|
53
|
-
| Description TEXT Newline
|
52
|
+
TEXT Newline { result = val[0] }
|
53
|
+
| Description TEXT Newline { result = val[0...-1].flatten }
|
54
54
|
;
|
55
55
|
|
56
56
|
Background:
|
@@ -96,8 +96,8 @@ racc_reduce_table = [
|
|
96
96
|
3, 20, :_reduce_13,
|
97
97
|
2, 22, :_reduce_14,
|
98
98
|
3, 22, :_reduce_15,
|
99
|
-
2, 23, :
|
100
|
-
3, 23, :
|
99
|
+
2, 23, :_reduce_16,
|
100
|
+
3, 23, :_reduce_17,
|
101
101
|
2, 21, :_reduce_18,
|
102
102
|
2, 24, :_reduce_19,
|
103
103
|
1, 25, :_reduce_20,
|
@@ -268,7 +268,7 @@ module_eval(<<'.,.,', 'gherkin.y', 40)
|
|
268
268
|
|
269
269
|
module_eval(<<'.,.,', 'gherkin.y', 42)
|
270
270
|
def _reduce_13(val, _values, result)
|
271
|
-
result = val[0]
|
271
|
+
result = val[0]; result.description = val[2]
|
272
272
|
result
|
273
273
|
end
|
274
274
|
.,.,
|
@@ -287,9 +287,19 @@ module_eval(<<'.,.,', 'gherkin.y', 47)
|
|
287
287
|
end
|
288
288
|
.,.,
|
289
289
|
|
290
|
-
|
290
|
+
module_eval(<<'.,.,', 'gherkin.y', 51)
|
291
|
+
def _reduce_16(val, _values, result)
|
292
|
+
result = val[0]
|
293
|
+
result
|
294
|
+
end
|
295
|
+
.,.,
|
291
296
|
|
292
|
-
|
297
|
+
module_eval(<<'.,.,', 'gherkin.y', 52)
|
298
|
+
def _reduce_17(val, _values, result)
|
299
|
+
result = val[0...-1].flatten
|
300
|
+
result
|
301
|
+
end
|
302
|
+
.,.,
|
293
303
|
|
294
304
|
module_eval(<<'.,.,', 'gherkin.y', 57)
|
295
305
|
def _reduce_18(val, _values, result)
|
data/lib/gherkin/version.rb
CHANGED
data/test/gherkin/parser_test.rb
CHANGED
@@ -32,6 +32,10 @@ module Gherkin
|
|
32
32
|
it 'generates a nice tree' do
|
33
33
|
@result.must_be_kind_of AST::Feature
|
34
34
|
@result.line.must_equal 1
|
35
|
+
@result.description.must_equal [
|
36
|
+
"In order to do something",
|
37
|
+
"As a developer",
|
38
|
+
"I want to be happy"]
|
35
39
|
|
36
40
|
background = @result.background
|
37
41
|
background.must_be_kind_of AST::Background
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gherkin-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-06-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rexical
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
- - ! '>='
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '0'
|
23
|
-
type: :
|
23
|
+
type: :development
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
none: false
|