gherkin 2.4.21-x86-mswin32 → 2.5.0-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/Gemfile.lock +5 -6
  2. data/History.md +71 -0
  3. data/features/json_formatter.feature +134 -80
  4. data/features/json_parser.feature +8 -12
  5. data/gherkin.gemspec +2 -2
  6. data/lib/1.8/gherkin_lexer_ar.so +0 -0
  7. data/lib/1.8/gherkin_lexer_bg.so +0 -0
  8. data/lib/1.8/gherkin_lexer_ca.so +0 -0
  9. data/lib/1.8/gherkin_lexer_cs.so +0 -0
  10. data/lib/1.8/gherkin_lexer_cy_gb.so +0 -0
  11. data/lib/1.8/gherkin_lexer_da.so +0 -0
  12. data/lib/1.8/gherkin_lexer_de.so +0 -0
  13. data/lib/1.8/gherkin_lexer_en.so +0 -0
  14. data/lib/1.8/gherkin_lexer_en_au.so +0 -0
  15. data/lib/1.8/gherkin_lexer_en_lol.so +0 -0
  16. data/lib/1.8/gherkin_lexer_en_pirate.so +0 -0
  17. data/lib/1.8/gherkin_lexer_en_scouse.so +0 -0
  18. data/lib/1.8/gherkin_lexer_en_tx.so +0 -0
  19. data/lib/1.8/gherkin_lexer_eo.so +0 -0
  20. data/lib/1.8/gherkin_lexer_es.so +0 -0
  21. data/lib/1.8/gherkin_lexer_et.so +0 -0
  22. data/lib/1.8/gherkin_lexer_fi.so +0 -0
  23. data/lib/1.8/gherkin_lexer_fr.so +0 -0
  24. data/lib/1.8/gherkin_lexer_he.so +0 -0
  25. data/lib/1.8/gherkin_lexer_hr.so +0 -0
  26. data/lib/1.8/gherkin_lexer_hu.so +0 -0
  27. data/lib/1.8/gherkin_lexer_id.so +0 -0
  28. data/lib/1.8/gherkin_lexer_is.so +0 -0
  29. data/lib/1.8/gherkin_lexer_it.so +0 -0
  30. data/lib/1.8/gherkin_lexer_ja.so +0 -0
  31. data/lib/1.8/gherkin_lexer_ko.so +0 -0
  32. data/lib/1.8/gherkin_lexer_lt.so +0 -0
  33. data/lib/1.8/gherkin_lexer_lu.so +0 -0
  34. data/lib/1.8/gherkin_lexer_lv.so +0 -0
  35. data/lib/1.8/gherkin_lexer_nl.so +0 -0
  36. data/lib/1.8/gherkin_lexer_no.so +0 -0
  37. data/lib/1.8/gherkin_lexer_pl.so +0 -0
  38. data/lib/1.8/gherkin_lexer_pt.so +0 -0
  39. data/lib/1.8/gherkin_lexer_ro.so +0 -0
  40. data/lib/1.8/gherkin_lexer_ru.so +0 -0
  41. data/lib/1.8/gherkin_lexer_sk.so +0 -0
  42. data/lib/1.8/gherkin_lexer_sr_cyrl.so +0 -0
  43. data/lib/1.8/gherkin_lexer_sr_latn.so +0 -0
  44. data/lib/1.8/gherkin_lexer_sv.so +0 -0
  45. data/lib/1.8/gherkin_lexer_tr.so +0 -0
  46. data/lib/1.8/gherkin_lexer_uk.so +0 -0
  47. data/lib/1.8/gherkin_lexer_uz.so +0 -0
  48. data/lib/1.8/gherkin_lexer_vi.so +0 -0
  49. data/lib/1.8/gherkin_lexer_zh_cn.so +0 -0
  50. data/lib/1.8/gherkin_lexer_zh_tw.so +0 -0
  51. data/lib/1.9/gherkin_lexer_ar.so +0 -0
  52. data/lib/1.9/gherkin_lexer_bg.so +0 -0
  53. data/lib/1.9/gherkin_lexer_ca.so +0 -0
  54. data/lib/1.9/gherkin_lexer_cs.so +0 -0
  55. data/lib/1.9/gherkin_lexer_cy_gb.so +0 -0
  56. data/lib/1.9/gherkin_lexer_da.so +0 -0
  57. data/lib/1.9/gherkin_lexer_de.so +0 -0
  58. data/lib/1.9/gherkin_lexer_en.so +0 -0
  59. data/lib/1.9/gherkin_lexer_en_au.so +0 -0
  60. data/lib/1.9/gherkin_lexer_en_lol.so +0 -0
  61. data/lib/1.9/gherkin_lexer_en_pirate.so +0 -0
  62. data/lib/1.9/gherkin_lexer_en_scouse.so +0 -0
  63. data/lib/1.9/gherkin_lexer_en_tx.so +0 -0
  64. data/lib/1.9/gherkin_lexer_eo.so +0 -0
  65. data/lib/1.9/gherkin_lexer_es.so +0 -0
  66. data/lib/1.9/gherkin_lexer_et.so +0 -0
  67. data/lib/1.9/gherkin_lexer_fi.so +0 -0
  68. data/lib/1.9/gherkin_lexer_fr.so +0 -0
  69. data/lib/1.9/gherkin_lexer_he.so +0 -0
  70. data/lib/1.9/gherkin_lexer_hr.so +0 -0
  71. data/lib/1.9/gherkin_lexer_hu.so +0 -0
  72. data/lib/1.9/gherkin_lexer_id.so +0 -0
  73. data/lib/1.9/gherkin_lexer_is.so +0 -0
  74. data/lib/1.9/gherkin_lexer_it.so +0 -0
  75. data/lib/1.9/gherkin_lexer_ja.so +0 -0
  76. data/lib/1.9/gherkin_lexer_ko.so +0 -0
  77. data/lib/1.9/gherkin_lexer_lt.so +0 -0
  78. data/lib/1.9/gherkin_lexer_lu.so +0 -0
  79. data/lib/1.9/gherkin_lexer_lv.so +0 -0
  80. data/lib/1.9/gherkin_lexer_nl.so +0 -0
  81. data/lib/1.9/gherkin_lexer_no.so +0 -0
  82. data/lib/1.9/gherkin_lexer_pl.so +0 -0
  83. data/lib/1.9/gherkin_lexer_pt.so +0 -0
  84. data/lib/1.9/gherkin_lexer_ro.so +0 -0
  85. data/lib/1.9/gherkin_lexer_ru.so +0 -0
  86. data/lib/1.9/gherkin_lexer_sk.so +0 -0
  87. data/lib/1.9/gherkin_lexer_sr_cyrl.so +0 -0
  88. data/lib/1.9/gherkin_lexer_sr_latn.so +0 -0
  89. data/lib/1.9/gherkin_lexer_sv.so +0 -0
  90. data/lib/1.9/gherkin_lexer_tr.so +0 -0
  91. data/lib/1.9/gherkin_lexer_uk.so +0 -0
  92. data/lib/1.9/gherkin_lexer_uz.so +0 -0
  93. data/lib/1.9/gherkin_lexer_vi.so +0 -0
  94. data/lib/1.9/gherkin_lexer_zh_cn.so +0 -0
  95. data/lib/1.9/gherkin_lexer_zh_tw.so +0 -0
  96. data/lib/gherkin/formatter/json_formatter.rb +10 -6
  97. data/lib/gherkin/formatter/model.rb +6 -20
  98. data/lib/gherkin/formatter/pretty_formatter.rb +3 -6
  99. data/lib/gherkin/json_parser.rb +5 -6
  100. data/lib/gherkin/listener/formatter_listener.rb +5 -1
  101. data/spec/gherkin/fixtures/complex.json +30 -42
  102. data/spec/gherkin/formatter/json_formatter_spec.rb +74 -0
  103. data/spec/gherkin/json_parser_spec.rb +5 -8
  104. data/tasks/cucumber.rake +1 -0
  105. metadata +26 -24
@@ -1,21 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gherkin (2.4.21)
4
+ gherkin (2.5.0)
5
5
  json (>= 1.4.6)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
10
  builder (3.0.0)
11
- cucumber (1.0.6)
11
+ cucumber (1.1.0)
12
12
  builder (>= 2.1.2)
13
13
  diff-lcs (>= 1.1.2)
14
- gherkin (~> 2.4.18)
14
+ gherkin (~> 2.5.0)
15
15
  json (>= 1.4.6)
16
16
  term-ansicolor (>= 1.0.6)
17
17
  diff-lcs (1.1.3)
18
- json (1.6.0)
18
+ json (1.6.1)
19
19
  libv8 (3.3.10.2)
20
20
  rake (0.9.2)
21
21
  rake-compiler (0.7.9)
@@ -35,13 +35,12 @@ GEM
35
35
  yard (0.7.2)
36
36
 
37
37
  PLATFORMS
38
- java
39
38
  ruby
40
39
 
41
40
  DEPENDENCIES
42
41
  builder (>= 2.1.2)
43
42
  bundler (>= 1.0.18)
44
- cucumber (>= 1.0.6)
43
+ cucumber (>= 1.1.0)
45
44
  gherkin!
46
45
  rake (>= 0.9.2)
47
46
  rake-compiler (>= 0.7.9)
data/History.md CHANGED
@@ -1,3 +1,74 @@
1
+ ## [2.5.0](https://github.com/cucumber/gherkin/compare/v2.4.21...v2.5.0)
2
+
3
+ ### Changed Features
4
+
5
+ The JSON representation of features has changed. The difference lies in how Doc Strings and Data Tables are represented. Consider the following steps:
6
+
7
+ Given a Data Table:
8
+ | Hipster | Ipsum |
9
+ | Freegan | Vinyl |
10
+ Given a Doc String:
11
+ """
12
+ Hipster
13
+ Ipsum
14
+ """
15
+
16
+ This is now represented in JSON as:
17
+
18
+ "steps": [
19
+ {
20
+ "keyword": "Given ",
21
+ "name": "a Data Table"
22
+ "line": 5,
23
+ "rows": [
24
+ { "cells": ["Hipster", "Ipsum"], "line": 6 },
25
+ { "cells": ["Freegan", "Vinyl"], "line": 7 }
26
+ ]
27
+ },
28
+ {
29
+ "keyword": "Given ",
30
+ "name": "a Doc String"
31
+ "line": 8,
32
+ "doc_string": {
33
+ "value": "Hipster\nIpsum"
34
+ "line": 9,
35
+ "content_type": "plaintext",
36
+ }
37
+ }
38
+ ]
39
+
40
+ Previously it would be represented in JSON as:
41
+
42
+ "steps": [
43
+ {
44
+ "keyword": "Given ",
45
+ "name": "a Data Table"
46
+ "line": 5,
47
+ "multiline_arg": {
48
+ "type": "table"
49
+ "value": [
50
+ { "cells": ["Hipster", "Ipsum"], "line": 6 },
51
+ { "cells": ["Freegan", "Vinyl"], "line": 7 }
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "keyword": "Given ",
57
+ "name": "a Doc String"
58
+ "line": 8,
59
+ "multiline_arg": {
60
+ "type": "doc_string"
61
+ "value": "Hipster\nIpsum"
62
+ "line": 9,
63
+ "content_type": "plaintext",
64
+ }
65
+ }
66
+ ]
67
+
68
+ ### Bugfixes
69
+ * Java JSONFormatter produces invalid JSON ([#128](https://github.com/cucumber/gherkin/issues/128) Aslak Hellesøy)
70
+ * Missing matches and results in JSONFormatter output ([#129](https://github.com/cucumber/gherkin/issues/129) Aslak Hellesøy)
71
+
1
72
  ## [2.4.21](https://github.com/cucumber/gherkin/compare/v2.4.20...v2.4.21)
2
73
 
3
74
  ### Bugfixes
@@ -71,154 +71,208 @@ Feature: JSON formatter
71
71
  Then the outputted JSON should be:
72
72
  """
73
73
  {
74
- "tags": [{"name": "@one", "line":1}],
75
- "keyword": "Feature",
76
- "name": "OH HAI",
77
74
  "description": "",
78
- "line": 2,
79
- "elements":[
75
+ "elements": [
80
76
  {
81
- "type": "scenario",
82
- "keyword": "Scenario",
83
- "name": "Fujin",
84
77
  "description": "",
78
+ "keyword": "Scenario",
85
79
  "line": 4,
80
+ "name": "Fujin",
86
81
  "steps": [
87
82
  {
88
83
  "keyword": "Given ",
89
- "name": "wind",
90
- "line": 5
84
+ "line": 5,
85
+ "name": "wind"
91
86
  },
92
87
  {
93
88
  "keyword": "Then ",
94
- "name": "spirit",
95
- "line": 6
89
+ "line": 6,
90
+ "name": "spirit"
96
91
  }
97
- ]
92
+ ],
93
+ "type": "scenario"
98
94
  },
99
95
  {
100
- "type": "scenario",
101
- "tags": [{"name": "@two", "line":8}],
102
- "keyword": "Scenario",
103
- "name": "_why",
104
96
  "description": "",
97
+ "keyword": "Scenario",
105
98
  "line": 9,
99
+ "name": "_why",
106
100
  "steps": [
107
101
  {
108
102
  "keyword": "Given ",
109
- "name": "chunky",
110
- "line": 10
103
+ "line": 10,
104
+ "name": "chunky"
111
105
  },
112
106
  {
113
107
  "keyword": "Then ",
114
- "name": "bacon",
115
- "line": 11
108
+ "line": 11,
109
+ "name": "bacon"
116
110
  }
117
- ]
118
- },
119
- {
120
- "type": "scenario_outline",
121
- "tags": [{"name": "@three", "line":13}, {"name": "@four", "line":13}],
122
- "keyword": "Scenario Outline",
123
- "name": "Life",
124
- "description": "",
125
- "line": 14,
126
- "steps": [
111
+ ],
112
+ "tags": [
127
113
  {
128
- "keyword": "Given ",
129
- "name": "some <boredom>",
130
- "line": 15
114
+ "line": 8,
115
+ "name": "@two"
131
116
  }
132
117
  ],
118
+ "type": "scenario"
119
+ },
120
+ {
121
+ "description": "",
133
122
  "examples": [
134
123
  {
135
- "tags": [{"name": "@five", "line":17}],
136
- "keyword": "Examples",
137
- "name": "Real life",
138
124
  "description": "",
125
+ "keyword": "Examples",
139
126
  "line": 18,
127
+ "name": "Real life",
140
128
  "rows": [
141
129
  {
142
- "cells": ["boredom"],
130
+ "cells": [
131
+ "boredom"
132
+ ],
143
133
  "line": 19
144
134
  },
145
135
  {
146
- "cells": ["airport"],
136
+ "cells": [
137
+ "airport"
138
+ ],
147
139
  "line": 20
148
140
  },
149
141
  {
150
- "cells": ["meeting"],
142
+ "cells": [
143
+ "meeting"
144
+ ],
151
145
  "line": 21
152
146
  }
147
+ ],
148
+ "tags": [
149
+ {
150
+ "line": 17,
151
+ "name": "@five"
152
+ }
153
153
  ]
154
154
  }
155
- ]
155
+ ],
156
+ "keyword": "Scenario Outline",
157
+ "line": 14,
158
+ "name": "Life",
159
+ "steps": [
160
+ {
161
+ "keyword": "Given ",
162
+ "line": 15,
163
+ "name": "some <boredom>"
164
+ }
165
+ ],
166
+ "tags": [
167
+ {
168
+ "line": 13,
169
+ "name": "@three"
170
+ },
171
+ {
172
+ "line": 13,
173
+ "name": "@four"
174
+ }
175
+ ],
176
+ "type": "scenario_outline"
156
177
  },
157
178
  {
158
- "type": "scenario",
159
- "keyword": "Scenario",
160
- "name": "who stole my mojo?",
161
179
  "description": "",
180
+ "keyword": "Scenario",
162
181
  "line": 23,
182
+ "name": "who stole my mojo?",
163
183
  "steps": [
164
184
  {
165
185
  "keyword": "When ",
166
- "name": "I was",
167
186
  "line": 24,
168
- "multiline_arg": {
169
- "type": "table",
170
- "value": [
171
- {
172
- "line": 25,
173
- "cells": ["asleep"]
174
- }
175
- ]
176
- }
187
+ "name": "I was",
188
+ "rows": [
189
+ {
190
+ "cells": [
191
+ "asleep"
192
+ ],
193
+ "line": 25
194
+ }
195
+ ]
177
196
  },
178
197
  {
198
+ "doc_string": {
199
+ "content_type": "plaintext",
200
+ "line": 27,
201
+ "value": "innocent"
202
+ },
179
203
  "keyword": "And ",
180
- "name": "so",
181
204
  "line": 26,
182
- "multiline_arg": {
183
- "type": "doc_string",
184
- "content_type": "plaintext",
185
- "value": "innocent",
186
- "line": 27
187
- }
205
+ "name": "so"
188
206
  }
189
- ]
207
+ ],
208
+ "type": "scenario"
190
209
  },
191
210
  {
192
- "type": "scenario_outline",
193
- "comments": [{"value": "# The", "line":31}],
194
- "keyword": "Scenario Outline",
195
- "name": "with",
196
- "description": "",
197
- "line": 32,
198
- "steps": [
211
+ "comments": [
199
212
  {
200
- "comments": [{"value": "# all", "line":33}],
201
- "keyword": "Then ",
202
- "line": 34,
203
- "name": "nice"
213
+ "line": 31,
214
+ "value": "# The"
204
215
  }
205
216
  ],
217
+ "description": "",
206
218
  "examples": [
207
219
  {
208
- "comments": [{"value": "# comments", "line": 36}, {"value": "# everywhere", "line": 37}],
209
- "keyword": "Examples",
210
- "name": "An example",
220
+ "comments": [
221
+ {
222
+ "line": 36,
223
+ "value": "# comments"
224
+ },
225
+ {
226
+ "line": 37,
227
+ "value": "# everywhere"
228
+ }
229
+ ],
211
230
  "description": "",
231
+ "keyword": "Examples",
212
232
  "line": 38,
233
+ "name": "An example",
213
234
  "rows": [
214
235
  {
215
- "comments": [{"value": "# I mean", "line": 39}],
216
- "line": 40,
217
- "cells": ["partout"]
236
+ "cells": [
237
+ "partout"
238
+ ],
239
+ "comments": [
240
+ {
241
+ "line": 39,
242
+ "value": "# I mean"
243
+ }
244
+ ],
245
+ "line": 40
218
246
  }
219
247
  ]
220
248
  }
221
- ]
249
+ ],
250
+ "keyword": "Scenario Outline",
251
+ "line": 32,
252
+ "name": "with",
253
+ "steps": [
254
+ {
255
+ "comments": [
256
+ {
257
+ "line": 33,
258
+ "value": "# all"
259
+ }
260
+ ],
261
+ "keyword": "Then ",
262
+ "line": 34,
263
+ "name": "nice"
264
+ }
265
+ ],
266
+ "type": "scenario_outline"
267
+ }
268
+ ],
269
+ "keyword": "Feature",
270
+ "line": 2,
271
+ "name": "OH HAI",
272
+ "tags": [
273
+ {
274
+ "line": 1,
275
+ "name": "@one"
222
276
  }
223
277
  ]
224
278
  }
@@ -144,24 +144,20 @@ Feature: JSON lexer
144
144
  "keyword": "When ",
145
145
  "name": "I was",
146
146
  "line": 24,
147
- "multiline_arg": {
148
- "type": "table",
149
- "value": [
150
- {
151
- "comments": [],
152
- "line": 25,
153
- "cells": ["asleep"]
154
- }
155
- ]
156
- }
147
+ "rows": [
148
+ {
149
+ "comments": [],
150
+ "line": 25,
151
+ "cells": ["asleep"]
152
+ }
153
+ ]
157
154
  },
158
155
  {
159
156
  "comments": [],
160
157
  "keyword": "And ",
161
158
  "name": "so",
162
159
  "line": 26,
163
- "multiline_arg": {
164
- "type": "doc_string",
160
+ "doc_string": {
165
161
  "value": "innocent",
166
162
  "line": 27
167
163
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "gherkin"
5
- s.version = "2.4.21"
5
+ s.version = "2.5.0"
6
6
  s.authors = ["Mike Sassak", "Gregory Hnatiuk", "Aslak Hellesøy"]
7
7
  s.description = "A fast Gherkin lexer/parser based on the Ragel State Machine Compiler."
8
8
  s.summary = "#{s.name}-#{s.version}"
@@ -46,7 +46,7 @@ Gem::Specification.new do |s|
46
46
  # Hack because json is released as two different versions for MRI and JRuby :-/
47
47
  s.add_dependency('json', '>= 1.4.6')
48
48
 
49
- s.add_development_dependency('cucumber', '>= 1.0.6')
49
+ s.add_development_dependency('cucumber', '>= 1.1.0')
50
50
  s.add_development_dependency('rake', '>= 0.9.2')
51
51
  s.add_development_dependency('bundler', '>= 1.0.18')
52
52
  s.add_development_dependency('rspec', '>= 2.6.0')