gherkin 2.5.4-x86-mswin32 → 2.6.0-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. data/Gemfile +2 -0
  2. data/Gemfile.lock +9 -7
  3. data/History.md +11 -1
  4. data/README.md +1 -1
  5. data/features/json_formatter.feature +376 -310
  6. data/features/json_parser.feature +245 -228
  7. data/features/step_definitions/json_formatter_steps.rb +7 -4
  8. data/features/step_definitions/json_parser_steps.rb +1 -1
  9. data/features/step_definitions/pretty_formatter_steps.rb +2 -1
  10. data/gherkin.gemspec +4 -3
  11. data/lib/1.8/gherkin_lexer_ar.so +0 -0
  12. data/lib/1.8/gherkin_lexer_bg.so +0 -0
  13. data/lib/1.8/gherkin_lexer_ca.so +0 -0
  14. data/lib/1.8/gherkin_lexer_cs.so +0 -0
  15. data/lib/1.8/gherkin_lexer_cy_gb.so +0 -0
  16. data/lib/1.8/gherkin_lexer_da.so +0 -0
  17. data/lib/1.8/gherkin_lexer_de.so +0 -0
  18. data/lib/1.8/gherkin_lexer_en.so +0 -0
  19. data/lib/1.8/gherkin_lexer_en_au.so +0 -0
  20. data/lib/1.8/gherkin_lexer_en_lol.so +0 -0
  21. data/lib/1.8/gherkin_lexer_en_pirate.so +0 -0
  22. data/lib/1.8/gherkin_lexer_en_scouse.so +0 -0
  23. data/lib/1.8/gherkin_lexer_en_tx.so +0 -0
  24. data/lib/1.8/gherkin_lexer_eo.so +0 -0
  25. data/lib/1.8/gherkin_lexer_es.so +0 -0
  26. data/lib/1.8/gherkin_lexer_et.so +0 -0
  27. data/lib/1.8/gherkin_lexer_fi.so +0 -0
  28. data/lib/1.8/gherkin_lexer_fr.so +0 -0
  29. data/lib/1.8/gherkin_lexer_he.so +0 -0
  30. data/lib/1.8/gherkin_lexer_hr.so +0 -0
  31. data/lib/1.8/gherkin_lexer_hu.so +0 -0
  32. data/lib/1.8/gherkin_lexer_id.so +0 -0
  33. data/lib/1.8/gherkin_lexer_is.so +0 -0
  34. data/lib/1.8/gherkin_lexer_it.so +0 -0
  35. data/lib/1.8/gherkin_lexer_ja.so +0 -0
  36. data/lib/1.8/gherkin_lexer_ko.so +0 -0
  37. data/lib/1.8/gherkin_lexer_lt.so +0 -0
  38. data/lib/1.8/gherkin_lexer_lu.so +0 -0
  39. data/lib/1.8/gherkin_lexer_lv.so +0 -0
  40. data/lib/1.8/gherkin_lexer_nl.so +0 -0
  41. data/lib/1.8/gherkin_lexer_no.so +0 -0
  42. data/lib/1.8/gherkin_lexer_pl.so +0 -0
  43. data/lib/1.8/gherkin_lexer_pt.so +0 -0
  44. data/lib/1.8/gherkin_lexer_ro.so +0 -0
  45. data/lib/1.8/gherkin_lexer_ru.so +0 -0
  46. data/lib/1.8/gherkin_lexer_sk.so +0 -0
  47. data/lib/1.8/gherkin_lexer_sr_cyrl.so +0 -0
  48. data/lib/1.8/gherkin_lexer_sr_latn.so +0 -0
  49. data/lib/1.8/gherkin_lexer_sv.so +0 -0
  50. data/lib/1.8/gherkin_lexer_tr.so +0 -0
  51. data/lib/1.8/gherkin_lexer_uk.so +0 -0
  52. data/lib/1.8/gherkin_lexer_uz.so +0 -0
  53. data/lib/1.8/gherkin_lexer_vi.so +0 -0
  54. data/lib/1.8/gherkin_lexer_zh_cn.so +0 -0
  55. data/lib/1.8/gherkin_lexer_zh_tw.so +0 -0
  56. data/lib/1.9/gherkin_lexer_ar.so +0 -0
  57. data/lib/1.9/gherkin_lexer_bg.so +0 -0
  58. data/lib/1.9/gherkin_lexer_ca.so +0 -0
  59. data/lib/1.9/gherkin_lexer_cs.so +0 -0
  60. data/lib/1.9/gherkin_lexer_cy_gb.so +0 -0
  61. data/lib/1.9/gherkin_lexer_da.so +0 -0
  62. data/lib/1.9/gherkin_lexer_de.so +0 -0
  63. data/lib/1.9/gherkin_lexer_en.so +0 -0
  64. data/lib/1.9/gherkin_lexer_en_au.so +0 -0
  65. data/lib/1.9/gherkin_lexer_en_lol.so +0 -0
  66. data/lib/1.9/gherkin_lexer_en_pirate.so +0 -0
  67. data/lib/1.9/gherkin_lexer_en_scouse.so +0 -0
  68. data/lib/1.9/gherkin_lexer_en_tx.so +0 -0
  69. data/lib/1.9/gherkin_lexer_eo.so +0 -0
  70. data/lib/1.9/gherkin_lexer_es.so +0 -0
  71. data/lib/1.9/gherkin_lexer_et.so +0 -0
  72. data/lib/1.9/gherkin_lexer_fi.so +0 -0
  73. data/lib/1.9/gherkin_lexer_fr.so +0 -0
  74. data/lib/1.9/gherkin_lexer_he.so +0 -0
  75. data/lib/1.9/gherkin_lexer_hr.so +0 -0
  76. data/lib/1.9/gherkin_lexer_hu.so +0 -0
  77. data/lib/1.9/gherkin_lexer_id.so +0 -0
  78. data/lib/1.9/gherkin_lexer_is.so +0 -0
  79. data/lib/1.9/gherkin_lexer_it.so +0 -0
  80. data/lib/1.9/gherkin_lexer_ja.so +0 -0
  81. data/lib/1.9/gherkin_lexer_ko.so +0 -0
  82. data/lib/1.9/gherkin_lexer_lt.so +0 -0
  83. data/lib/1.9/gherkin_lexer_lu.so +0 -0
  84. data/lib/1.9/gherkin_lexer_lv.so +0 -0
  85. data/lib/1.9/gherkin_lexer_nl.so +0 -0
  86. data/lib/1.9/gherkin_lexer_no.so +0 -0
  87. data/lib/1.9/gherkin_lexer_pl.so +0 -0
  88. data/lib/1.9/gherkin_lexer_pt.so +0 -0
  89. data/lib/1.9/gherkin_lexer_ro.so +0 -0
  90. data/lib/1.9/gherkin_lexer_ru.so +0 -0
  91. data/lib/1.9/gherkin_lexer_sk.so +0 -0
  92. data/lib/1.9/gherkin_lexer_sr_cyrl.so +0 -0
  93. data/lib/1.9/gherkin_lexer_sr_latn.so +0 -0
  94. data/lib/1.9/gherkin_lexer_sv.so +0 -0
  95. data/lib/1.9/gherkin_lexer_tr.so +0 -0
  96. data/lib/1.9/gherkin_lexer_uk.so +0 -0
  97. data/lib/1.9/gherkin_lexer_uz.so +0 -0
  98. data/lib/1.9/gherkin_lexer_vi.so +0 -0
  99. data/lib/1.9/gherkin_lexer_zh_cn.so +0 -0
  100. data/lib/1.9/gherkin_lexer_zh_tw.so +0 -0
  101. data/lib/gherkin/formatter/json_formatter.rb +13 -9
  102. data/lib/gherkin/formatter/model.rb +78 -20
  103. data/lib/gherkin/formatter/pretty_formatter.rb +1 -1
  104. data/lib/gherkin/json_parser.rb +32 -24
  105. data/lib/gherkin/listener/formatter_listener.rb +76 -50
  106. data/spec/gherkin/fixtures/complex.json +8 -1
  107. data/spec/gherkin/formatter/json_formatter_spec.rb +49 -43
  108. data/spec/gherkin/formatter/model_spec.rb +2 -2
  109. data/spec/gherkin/formatter/pretty_formatter_spec.rb +10 -10
  110. data/spec/gherkin/json_parser_spec.rb +93 -77
  111. data/spec/gherkin/sexp_recorder.rb +0 -3
  112. metadata +25 -25
@@ -9,17 +9,20 @@ Feature: JSON lexer
9
9
  Scenario: Only a Feature
10
10
  Given the following JSON is parsed:
11
11
  """
12
- {
13
- "comments": [
14
- {"value": "# language: no"},
15
- {"value": "# Another comment"}
16
- ],
17
- "description": "",
18
- "keyword": "Egenskap",
19
- "name": "Kjapp",
20
- "tags": [],
21
- "uri": "test.feature"
22
- }
12
+ [
13
+ {
14
+ "comments": [
15
+ {"value": "# language: no"},
16
+ {"value": "# Another comment"}
17
+ ],
18
+ "description": "",
19
+ "keyword": "Egenskap",
20
+ "id": "kjapp",
21
+ "name": "Kjapp",
22
+ "tags": [],
23
+ "uri": "test.feature"
24
+ }
25
+ ]
23
26
  """
24
27
  Then the outputted text should be:
25
28
  """
@@ -31,181 +34,191 @@ Feature: JSON lexer
31
34
  Scenario: Feature with scenarios and outlines
32
35
  Given the following JSON is parsed:
33
36
  """
34
- {
35
- "comments": [],
36
- "keyword": "Feature",
37
- "name": "OH HAI",
38
- "tags": [{"name": "@one"}],
39
- "uri": "test.feature",
40
- "description": "",
41
- "elements":[
42
- {
43
- "comments": [],
44
- "tags": [],
45
- "keyword": "Scenario",
46
- "name": "Fujin",
47
- "description": "",
48
- "type": "scenario",
49
- "line": 4,
50
- "steps": [
51
- {
52
- "comments": [],
53
- "keyword": "Given ",
54
- "name": "wind",
55
- "line": 5
56
- },
57
- {
58
- "comments": [],
59
- "keyword": "Then ",
60
- "name": "spirit",
61
- "line": 6
62
- }
63
- ]
64
- },
65
- {
66
- "comments": [],
67
- "tags": [{"name": "@two"}],
68
- "keyword": "Scenario",
69
- "name": "_why",
70
- "description": "",
71
- "type": "scenario",
72
- "line": 9,
73
- "steps": [
74
- {
75
- "comments": [],
76
- "keyword": "Given ",
77
- "name": "chunky",
78
- "line": 10
79
- },
80
- {
81
- "comments": [],
82
- "keyword": "Then ",
83
- "name": "bacon",
84
- "line": 11
85
- }
86
- ]
87
- },
88
- {
89
- "comments": [],
90
- "tags": [{"name": "@three"}, {"name": "@four"}],
91
- "keyword": "Scenario Outline",
92
- "name": "Life",
93
- "description": "",
94
- "type": "scenario_outline",
95
- "line": 14,
96
- "steps": [
97
- {
98
- "comments": [],
99
- "keyword": "Given ",
100
- "name": "some <boredom>",
101
- "line": 15
102
- }
103
- ],
104
- "examples": [
105
- {
106
- "type": "examples",
107
- "comments": [],
108
- "tags": [{"name": "@five"}],
109
- "keyword": "Examples",
110
- "name": "Real life",
111
- "description": "",
112
- "line": 18,
113
- "rows": [
114
- {
115
- "comments": [],
116
- "cells": ["boredom"],
117
- "line": 19
118
- },
119
- {
120
- "comments": [],
121
- "cells": ["airport"],
122
- "line": 20
123
- },
124
- {
125
- "comments": [],
126
- "cells": ["meeting"],
127
- "line": 21
128
- }
129
- ]
130
- }
131
- ]
132
- },
133
- {
134
- "comments": [],
135
- "tags": [],
136
- "keyword": "Scenario",
137
- "name": "who stole my mojo?",
138
- "description": "",
139
- "type": "scenario",
140
- "line": 23,
141
- "steps": [
142
- {
143
- "comments": [],
144
- "keyword": "When ",
145
- "name": "I was",
146
- "line": 24,
147
- "rows": [
148
- {
149
- "comments": [],
150
- "line": 25,
151
- "cells": ["asleep"]
152
- }
153
- ]
154
- },
155
- {
156
- "comments": [],
157
- "keyword": "And ",
158
- "name": "so",
159
- "line": 26,
160
- "doc_string": {
161
- "value": "innocent",
162
- "line": 27
37
+ [
38
+ {
39
+ "comments": [],
40
+ "keyword": "Feature",
41
+ "id": "oh-hai",
42
+ "name": "OH HAI",
43
+ "tags": [{"name": "@one"}],
44
+ "uri": "test.feature",
45
+ "description": "",
46
+ "elements":[
47
+ {
48
+ "comments": [],
49
+ "tags": [],
50
+ "keyword": "Scenario",
51
+ "id": "oh-hai/fujin",
52
+ "name": "Fujin",
53
+ "description": "",
54
+ "type": "scenario",
55
+ "line": 4,
56
+ "steps": [
57
+ {
58
+ "comments": [],
59
+ "keyword": "Given ",
60
+ "name": "wind",
61
+ "line": 5
62
+ },
63
+ {
64
+ "comments": [],
65
+ "keyword": "Then ",
66
+ "name": "spirit",
67
+ "line": 6
68
+ }
69
+ ]
70
+ },
71
+ {
72
+ "comments": [],
73
+ "tags": [{"name": "@two"}],
74
+ "keyword": "Scenario",
75
+ "id": "oh-hai/_why",
76
+ "name": "_why",
77
+ "description": "",
78
+ "type": "scenario",
79
+ "line": 9,
80
+ "steps": [
81
+ {
82
+ "comments": [],
83
+ "keyword": "Given ",
84
+ "name": "chunky",
85
+ "line": 10
86
+ },
87
+ {
88
+ "comments": [],
89
+ "keyword": "Then ",
90
+ "name": "bacon",
91
+ "line": 11
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ "comments": [],
97
+ "tags": [{"name": "@three"}, {"name": "@four"}],
98
+ "keyword": "Scenario Outline",
99
+ "id": "oh-hai/life",
100
+ "name": "Life",
101
+ "description": "",
102
+ "type": "scenario_outline",
103
+ "line": 14,
104
+ "steps": [
105
+ {
106
+ "comments": [],
107
+ "keyword": "Given ",
108
+ "name": "some <boredom>",
109
+ "line": 15
110
+ }
111
+ ],
112
+ "examples": [
113
+ {
114
+ "type": "examples",
115
+ "comments": [],
116
+ "tags": [{"name": "@five"}],
117
+ "keyword": "Examples",
118
+ "id": "oh-hai/life/real-life",
119
+ "name": "Real life",
120
+ "description": "",
121
+ "line": 18,
122
+ "rows": [
123
+ {
124
+ "comments": [],
125
+ "cells": ["boredom"],
126
+ "line": 19
127
+ },
128
+ {
129
+ "comments": [],
130
+ "cells": ["airport"],
131
+ "line": 20
132
+ },
133
+ {
134
+ "comments": [],
135
+ "cells": ["meeting"],
136
+ "line": 21
137
+ }
138
+ ]
163
139
  }
164
- }
165
- ]
166
- },
167
- {
168
- "comments": [{"value": "# The"}],
169
- "tags": [],
170
- "keyword": "Scenario Outline",
171
- "description": "",
172
- "type": "scenario_outline",
173
- "line": 32,
174
- "name": "with",
175
- "steps": [
176
- {
177
- "comments": [{"value": "# all"}],
178
- "keyword": "Then ",
179
- "line": 34,
180
- "name": "nice"
181
- }
182
- ],
183
- "examples": [
184
- {
185
- "type": "examples",
186
- "comments": [{"value": "# comments"}, {"value": "# everywhere"}],
187
- "tags": [],
188
- "keyword": "Examples",
189
- "name": "An example",
190
- "description": "",
191
- "line": 38,
192
- "rows": [
193
- {
194
- "comments": [{"value": "# I mean"}],
195
- "line": 40,
196
- "cells": ["partout"]
197
- },
198
- {
199
- "comments": [{"value": "# I really mean"}],
200
- "line": 40,
201
- "cells": ["bartout"]
140
+ ]
141
+ },
142
+ {
143
+ "comments": [],
144
+ "tags": [],
145
+ "keyword": "Scenario",
146
+ "id": "oh-hai/who-stole-my-mojo?",
147
+ "name": "who stole my mojo?",
148
+ "description": "",
149
+ "type": "scenario",
150
+ "line": 23,
151
+ "steps": [
152
+ {
153
+ "comments": [],
154
+ "keyword": "When ",
155
+ "name": "I was",
156
+ "line": 24,
157
+ "rows": [
158
+ {
159
+ "comments": [],
160
+ "line": 25,
161
+ "cells": ["asleep"]
162
+ }
163
+ ]
164
+ },
165
+ {
166
+ "comments": [],
167
+ "keyword": "And ",
168
+ "name": "so",
169
+ "line": 26,
170
+ "doc_string": {
171
+ "value": "innocent",
172
+ "line": 27
202
173
  }
203
- ]
204
- }
205
- ]
206
- }
207
- ]
208
- }
174
+ }
175
+ ]
176
+ },
177
+ {
178
+ "comments": [{"value": "# The"}],
179
+ "tags": [],
180
+ "keyword": "Scenario Outline",
181
+ "description": "",
182
+ "type": "scenario_outline",
183
+ "line": 32,
184
+ "id": "oh-hai/with",
185
+ "name": "with",
186
+ "steps": [
187
+ {
188
+ "comments": [{"value": "# all"}],
189
+ "keyword": "Then ",
190
+ "line": 34,
191
+ "name": "nice"
192
+ }
193
+ ],
194
+ "examples": [
195
+ {
196
+ "type": "examples",
197
+ "comments": [{"value": "# comments"}, {"value": "# everywhere"}],
198
+ "tags": [],
199
+ "keyword": "Examples",
200
+ "id": "oh-hai/with/an-example",
201
+ "name": "An example",
202
+ "description": "",
203
+ "line": 38,
204
+ "rows": [
205
+ {
206
+ "comments": [{"value": "# I mean"}],
207
+ "line": 40,
208
+ "cells": ["partout"]
209
+ },
210
+ {
211
+ "comments": [{"value": "# I really mean"}],
212
+ "line": 40,
213
+ "cells": ["bartout"]
214
+ }
215
+ ]
216
+ }
217
+ ]
218
+ }
219
+ ]
220
+ }
221
+ ]
209
222
  """
210
223
  Then the outputted text should be:
211
224
  """
@@ -253,52 +266,56 @@ Feature: JSON lexer
253
266
  | bartout |
254
267
  """
255
268
 
256
- Scenario: Feature with Background
269
+ Scenario: Feature with Background
257
270
  Given the following JSON is parsed:
258
271
  """
259
- {
260
- "comments": [],
261
- "description": "",
262
- "keyword": "Feature",
263
- "name": "Kjapp",
264
- "tags": [],
265
- "uri": "test.feature",
266
- "elements": [
267
- {
268
- "type": "background",
269
- "comments": [],
270
- "description": "",
271
- "keyword": "Background",
272
- "line": 2,
273
- "name": "No idea what Kjapp means",
274
- "steps": [
275
- {
276
- "comments": [],
277
- "keyword": "Given ",
278
- "line": 3,
279
- "name": "I Google it"
280
- }
281
- ]
282
- },
283
- {
284
- "type": "scenario",
285
- "comments": [{"value": "# Writing JSON by hand sucks"}],
286
- "tags": [],
287
- "keyword": "Scenario",
288
- "name": "",
289
- "description": "",
290
- "line": 6,
291
- "steps": [
292
- {
293
- "comments": [],
294
- "keyword": "Then ",
295
- "name": "I think it means \"fast\"",
296
- "line": 7
297
- }
298
- ]
299
- }
300
- ]
301
- }
272
+ [
273
+ {
274
+ "comments": [],
275
+ "description": "",
276
+ "keyword": "Feature",
277
+ "id": "kjapp",
278
+ "name": "Kjapp",
279
+ "tags": [],
280
+ "uri": "test.feature",
281
+ "elements": [
282
+ {
283
+ "type": "background",
284
+ "comments": [],
285
+ "description": "",
286
+ "keyword": "Background",
287
+ "line": 2,
288
+ "name": "No idea what Kjapp means",
289
+ "steps": [
290
+ {
291
+ "comments": [],
292
+ "keyword": "Given ",
293
+ "line": 3,
294
+ "name": "I Google it"
295
+ }
296
+ ]
297
+ },
298
+ {
299
+ "type": "scenario",
300
+ "comments": [{"value": "# Writing JSON by hand sucks"}],
301
+ "tags": [],
302
+ "keyword": "Scenario",
303
+ "id": "kjapp/",
304
+ "name": "",
305
+ "description": "",
306
+ "line": 6,
307
+ "steps": [
308
+ {
309
+ "comments": [],
310
+ "keyword": "Then ",
311
+ "name": "I think it means \"fast\"",
312
+ "line": 7
313
+ }
314
+ ]
315
+ }
316
+ ]
317
+ }
318
+ ]
302
319
  """
303
320
  Then the outputted text should be:
304
321
  """