gherkin-ruby 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
 
14
14
  s.rubyforge_project = "gherkin-ruby"
15
15
 
16
- s.add_runtime_dependency 'rexical'
16
+ s.add_development_dependency 'rexical'
17
17
  s.add_development_dependency 'minitest'
18
18
  s.add_development_dependency 'racc'
19
19
 
@@ -16,6 +16,7 @@ module Gherkin
16
16
  class Feature < Node
17
17
  attr_reader :name, :background, :scenarios, :tags
18
18
  attr_writer :background, :scenarios, :tags
19
+ attr_accessor :description
19
20
 
20
21
  include Enumerable
21
22
 
@@ -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, :_reduce_none,
100
- 3, 23, :_reduce_none,
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
- # reduce 16 omitted
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
- # reduce 17 omitted
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)
@@ -1,3 +1,3 @@
1
1
  module Gherkin
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -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.0
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-05-21 00:00:00.000000000 Z
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: :runtime
23
+ type: :development
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  none: false