gherkin 2.5.4 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
1
  source "http://rubygems.org"
2
2
  gemspec
3
+
4
+ # gem 'cucumber', :path => '../cucumber'
@@ -1,23 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gherkin (2.5.4)
4
+ gherkin (2.6.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.1.0)
11
+ cucumber (1.1.1)
12
12
  builder (>= 2.1.2)
13
13
  diff-lcs (>= 1.1.2)
14
- gherkin (~> 2.5.0)
14
+ gherkin (~> 2.6.0)
15
15
  json (>= 1.4.6)
16
16
  term-ansicolor (>= 1.0.6)
17
17
  diff-lcs (1.1.3)
18
18
  json (1.6.1)
19
+ json (1.6.1-java)
19
20
  libv8 (3.3.10.2)
20
- rake (0.9.2)
21
+ rake (0.9.2.2)
21
22
  rake-compiler (0.7.9)
22
23
  rake
23
24
  rdiscount (1.6.8)
@@ -25,7 +26,7 @@ GEM
25
26
  rspec-core (~> 2.7.0)
26
27
  rspec-expectations (~> 2.7.0)
27
28
  rspec-mocks (~> 2.7.0)
28
- rspec-core (2.7.0)
29
+ rspec-core (2.7.1)
29
30
  rspec-expectations (2.7.0)
30
31
  diff-lcs (~> 1.1.2)
31
32
  rspec-mocks (2.7.0)
@@ -35,17 +36,18 @@ GEM
35
36
  yard (0.7.3)
36
37
 
37
38
  PLATFORMS
39
+ java
38
40
  ruby
39
41
 
40
42
  DEPENDENCIES
41
43
  builder (>= 2.1.2)
42
44
  bundler (>= 1.0.21)
43
- cucumber (>= 1.1.0)
45
+ cucumber (>= 1.1.1)
44
46
  gherkin!
45
47
  rake (>= 0.9.2)
46
48
  rake-compiler (>= 0.7.9)
47
49
  rdiscount (>= 1.6.8)
48
- rspec (>= 2.6.0)
50
+ rspec (>= 2.7.0)
49
51
  term-ansicolor (>= 1.0.6)
50
52
  therubyracer (>= 0.9.8)
51
53
  yard (>= 0.7.2)
data/History.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [2.6.0](https://github.com/cucumber/gherkin/compare/v2.5.4...v2.6.0)
2
+
3
+ ### Changed Features
4
+
5
+ * JSON formatter must handle multiple features ([#140](https://github.com/cucumber/gherkin/issues/140) Aslak Hellesøy)
6
+
7
+ ### New Features
8
+
9
+ * Identifiers for Gherkin elements ([#131](https://github.com/cucumber/gherkin/issues/131) Matt Wynne, Aslak Hellesøy)
10
+
1
11
  ## [2.5.4](https://github.com/cucumber/gherkin/compare/v2.5.3...v2.5.4)
2
12
 
3
13
  ### New Features
@@ -15,7 +25,7 @@
15
25
  * Added synonyms for Portuguese. (Rodrigo Dumont)
16
26
  * Added synonyms for Italian. (Alessandro Mencarini)
17
27
  * Added synonyms for Spanish. (Nahuel Garbezza)
18
- * Added synonyms for French. (Julein Biezemans)
28
+ * Added synonyms for French. (Julien Biezemans)
19
29
 
20
30
  ## [2.5.1](https://github.com/cucumber/gherkin/compare/v2.5.0...v2.5.1)
21
31
 
data/README.md CHANGED
@@ -54,7 +54,7 @@ The jar file is in the central Maven repo.
54
54
  <dependency>
55
55
  <groupId>info.cukes</groupId>
56
56
  <artifactId>gherkin</artifactId>
57
- <version>2.5.4</version>
57
+ <version>2.6.0</version>
58
58
  </dependency>
59
59
 
60
60
  You can get it manually from [Maven Central](http://search.maven.org/#browse%7C-2073395818)
@@ -13,15 +13,52 @@ Feature: JSON formatter
13
13
  # Another comment
14
14
  Egenskap: Kjapp
15
15
  """
16
+ And the following text is parsed:
17
+ """
18
+ # language: no
19
+ # Yet another comment
20
+ Egenskap: Kjappere
21
+ """
16
22
  Then the outputted JSON should be:
17
23
  """
18
- {
19
- "comments": [{"value": "# language: no", "line": 1}, {"value": "# Another comment", "line": 2}],
20
- "keyword": "Egenskap",
21
- "name": "Kjapp",
22
- "description": "",
23
- "line": 3
24
- }
24
+ [
25
+ {
26
+ "comments": [
27
+ {
28
+ "line": 1,
29
+ "value": "# language: no"
30
+ },
31
+ {
32
+ "line": 2,
33
+ "value": "# Another comment"
34
+ }
35
+ ],
36
+ "description": "",
37
+ "keyword": "Egenskap",
38
+ "line": 3,
39
+ "name": "Kjapp",
40
+ "uri": "test.feature",
41
+ "id": "kjapp"
42
+ },
43
+ {
44
+ "comments": [
45
+ {
46
+ "line": 1,
47
+ "value": "# language: no"
48
+ },
49
+ {
50
+ "line": 2,
51
+ "value": "# Yet another comment"
52
+ }
53
+ ],
54
+ "description": "",
55
+ "keyword": "Egenskap",
56
+ "line": 3,
57
+ "name": "Kjappere",
58
+ "uri": "test.feature",
59
+ "id": "kjappere"
60
+ }
61
+ ]
25
62
  """
26
63
 
27
64
  Scenario: Feature with scenarios and outlines
@@ -70,212 +107,227 @@ Feature: JSON formatter
70
107
  """
71
108
  Then the outputted JSON should be:
72
109
  """
73
- {
74
- "description": "",
75
- "elements": [
76
- {
77
- "description": "",
78
- "keyword": "Scenario",
79
- "line": 4,
80
- "name": "Fujin",
81
- "steps": [
82
- {
83
- "keyword": "Given ",
84
- "line": 5,
85
- "name": "wind"
86
- },
87
- {
88
- "keyword": "Then ",
89
- "line": 6,
90
- "name": "spirit"
91
- }
92
- ],
93
- "type": "scenario"
94
- },
95
- {
96
- "description": "",
97
- "keyword": "Scenario",
98
- "line": 9,
99
- "name": "_why",
100
- "steps": [
101
- {
102
- "keyword": "Given ",
103
- "line": 10,
104
- "name": "chunky"
105
- },
106
- {
107
- "keyword": "Then ",
108
- "line": 11,
109
- "name": "bacon"
110
- }
111
- ],
112
- "tags": [
113
- {
114
- "line": 8,
115
- "name": "@two"
116
- }
117
- ],
118
- "type": "scenario"
119
- },
120
- {
121
- "description": "",
122
- "examples": [
123
- {
124
- "description": "",
125
- "keyword": "Examples",
126
- "line": 18,
127
- "name": "Real life",
128
- "rows": [
129
- {
130
- "cells": [
131
- "boredom"
132
- ],
133
- "line": 19
134
- },
135
- {
136
- "cells": [
137
- "airport"
138
- ],
139
- "line": 20
140
- },
141
- {
142
- "cells": [
143
- "meeting"
144
- ],
145
- "line": 21
146
- }
147
- ],
148
- "tags": [
149
- {
150
- "line": 17,
151
- "name": "@five"
152
- }
153
- ]
154
- }
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"
177
- },
178
- {
179
- "description": "",
180
- "keyword": "Scenario",
181
- "line": 23,
182
- "name": "who stole my mojo?",
183
- "steps": [
184
- {
185
- "keyword": "When ",
186
- "line": 24,
187
- "name": "I was",
188
- "rows": [
189
- {
190
- "cells": [
191
- "asleep"
192
- ],
193
- "line": 25
194
- }
195
- ]
196
- },
197
- {
198
- "doc_string": {
199
- "content_type": "plaintext",
200
- "line": 27,
201
- "value": "innocent"
110
+ [
111
+ {
112
+ "uri": "test.feature",
113
+ "description": "",
114
+ "elements": [
115
+ {
116
+ "description": "",
117
+ "keyword": "Scenario",
118
+ "line": 4,
119
+ "id": "oh-hai;fujin",
120
+ "name": "Fujin",
121
+ "steps": [
122
+ {
123
+ "keyword": "Given ",
124
+ "line": 5,
125
+ "name": "wind"
202
126
  },
203
- "keyword": "And ",
204
- "line": 26,
205
- "name": "so"
206
- }
207
- ],
208
- "type": "scenario"
209
- },
210
- {
211
- "comments": [
212
- {
213
- "line": 31,
214
- "value": "# The"
215
- }
216
- ],
217
- "description": "",
218
- "examples": [
219
- {
220
- "comments": [
221
- {
222
- "line": 36,
223
- "value": "# comments"
127
+ {
128
+ "keyword": "Then ",
129
+ "line": 6,
130
+ "name": "spirit"
131
+ }
132
+ ],
133
+ "type": "scenario"
134
+ },
135
+ {
136
+ "description": "",
137
+ "keyword": "Scenario",
138
+ "line": 9,
139
+ "id": "oh-hai;-why",
140
+ "name": "_why",
141
+ "steps": [
142
+ {
143
+ "keyword": "Given ",
144
+ "line": 10,
145
+ "name": "chunky"
146
+ },
147
+ {
148
+ "keyword": "Then ",
149
+ "line": 11,
150
+ "name": "bacon"
151
+ }
152
+ ],
153
+ "tags": [
154
+ {
155
+ "line": 8,
156
+ "name": "@two"
157
+ }
158
+ ],
159
+ "type": "scenario"
160
+ },
161
+ {
162
+ "description": "",
163
+ "examples": [
164
+ {
165
+ "description": "",
166
+ "keyword": "Examples",
167
+ "line": 18,
168
+ "id": "oh-hai;life;real-life",
169
+ "name": "Real life",
170
+ "rows": [
171
+ {
172
+ "id": "oh-hai;life;real-life;1",
173
+ "cells": [
174
+ "boredom"
175
+ ],
176
+ "line": 19
177
+ },
178
+ {
179
+ "id": "oh-hai;life;real-life;2",
180
+ "cells": [
181
+ "airport"
182
+ ],
183
+ "line": 20
184
+ },
185
+ {
186
+ "id": "oh-hai;life;real-life;3",
187
+ "cells": [
188
+ "meeting"
189
+ ],
190
+ "line": 21
191
+ }
192
+ ],
193
+ "tags": [
194
+ {
195
+ "line": 17,
196
+ "name": "@five"
197
+ }
198
+ ]
199
+ }
200
+ ],
201
+ "keyword": "Scenario Outline",
202
+ "line": 14,
203
+ "id": "oh-hai;life",
204
+ "name": "Life",
205
+ "steps": [
206
+ {
207
+ "keyword": "Given ",
208
+ "line": 15,
209
+ "name": "some <boredom>"
210
+ }
211
+ ],
212
+ "tags": [
213
+ {
214
+ "line": 13,
215
+ "name": "@three"
216
+ },
217
+ {
218
+ "line": 13,
219
+ "name": "@four"
220
+ }
221
+ ],
222
+ "type": "scenario_outline"
223
+ },
224
+ {
225
+ "description": "",
226
+ "keyword": "Scenario",
227
+ "line": 23,
228
+ "id": "oh-hai;who-stole-my-mojo?",
229
+ "name": "who stole my mojo?",
230
+ "steps": [
231
+ {
232
+ "keyword": "When ",
233
+ "line": 24,
234
+ "name": "I was",
235
+ "rows": [
236
+ {
237
+ "cells": [
238
+ "asleep"
239
+ ],
240
+ "line": 25
241
+ }
242
+ ]
243
+ },
244
+ {
245
+ "doc_string": {
246
+ "content_type": "plaintext",
247
+ "line": 27,
248
+ "value": "innocent"
224
249
  },
225
- {
226
- "line": 37,
227
- "value": "# everywhere"
228
- }
229
- ],
230
- "description": "",
231
- "keyword": "Examples",
232
- "line": 38,
233
- "name": "An example",
234
- "rows": [
235
- {
236
- "cells": [
237
- "partout"
238
- ],
239
- "comments": [
240
- {
241
- "line": 39,
242
- "value": "# I mean"
243
- }
244
- ],
245
- "line": 40
246
- }
247
- ]
248
- }
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"
276
- }
277
- ]
278
- }
250
+ "keyword": "And ",
251
+ "line": 26,
252
+ "name": "so"
253
+ }
254
+ ],
255
+ "type": "scenario"
256
+ },
257
+ {
258
+ "comments": [
259
+ {
260
+ "line": 31,
261
+ "value": "# The"
262
+ }
263
+ ],
264
+ "description": "",
265
+ "examples": [
266
+ {
267
+ "comments": [
268
+ {
269
+ "line": 36,
270
+ "value": "# comments"
271
+ },
272
+ {
273
+ "line": 37,
274
+ "value": "# everywhere"
275
+ }
276
+ ],
277
+ "description": "",
278
+ "keyword": "Examples",
279
+ "line": 38,
280
+ "id": "oh-hai;with;an-example",
281
+ "name": "An example",
282
+ "rows": [
283
+ {
284
+ "id": "oh-hai;with;an-example;1",
285
+ "cells": [
286
+ "partout"
287
+ ],
288
+ "comments": [
289
+ {
290
+ "line": 39,
291
+ "value": "# I mean"
292
+ }
293
+ ],
294
+ "line": 40
295
+ }
296
+ ]
297
+ }
298
+ ],
299
+ "keyword": "Scenario Outline",
300
+ "line": 32,
301
+ "id": "oh-hai;with",
302
+ "name": "with",
303
+ "steps": [
304
+ {
305
+ "comments": [
306
+ {
307
+ "line": 33,
308
+ "value": "# all"
309
+ }
310
+ ],
311
+ "keyword": "Then ",
312
+ "line": 34,
313
+ "name": "nice"
314
+ }
315
+ ],
316
+ "type": "scenario_outline"
317
+ }
318
+ ],
319
+ "keyword": "Feature",
320
+ "line": 2,
321
+ "id": "oh-hai",
322
+ "name": "OH HAI",
323
+ "tags": [
324
+ {
325
+ "line": 1,
326
+ "name": "@one"
327
+ }
328
+ ]
329
+ }
330
+ ]
279
331
  """
280
332
 
281
333
  Scenario: Feature with Background
@@ -292,43 +344,48 @@ Feature: JSON formatter
292
344
  """
293
345
  Then the outputted JSON should be:
294
346
  """
295
- {
296
- "keyword": "Feature",
297
- "name": "Kjapp",
298
- "description": "",
299
- "line": 1,
300
- "elements": [
301
- {
302
- "type": "background",
303
- "keyword": "Background",
304
- "line": 3,
305
- "name": "No idea what Kjapp means",
306
- "description": "",
307
- "steps": [
308
- {
309
- "keyword": "Given ",
310
- "line": 4,
311
- "name": "I Google it"
312
- }
313
- ]
314
- },
315
- {
316
- "type": "scenario",
317
- "comments": [{"value": "# Writing JSON by hand sucks", "line": 6}],
318
- "keyword": "Scenario",
319
- "name": "",
320
- "description": "",
321
- "line": 7,
322
- "steps": [
323
- {
324
- "keyword": "Then ",
325
- "name": "I think it means \"fast\"",
326
- "line": 8
327
- }
328
- ]
329
- }
330
- ]
331
- }
347
+ [
348
+ {
349
+ "uri": "test.feature",
350
+ "keyword": "Feature",
351
+ "name": "Kjapp",
352
+ "id": "kjapp",
353
+ "description": "",
354
+ "line": 1,
355
+ "elements": [
356
+ {
357
+ "type": "background",
358
+ "keyword": "Background",
359
+ "line": 3,
360
+ "name": "No idea what Kjapp means",
361
+ "description": "",
362
+ "steps": [
363
+ {
364
+ "keyword": "Given ",
365
+ "line": 4,
366
+ "name": "I Google it"
367
+ }
368
+ ]
369
+ },
370
+ {
371
+ "type": "scenario",
372
+ "comments": [{"value": "# Writing JSON by hand sucks", "line": 6}],
373
+ "keyword": "Scenario",
374
+ "id": "kjapp;",
375
+ "name": "",
376
+ "description": "",
377
+ "line": 7,
378
+ "steps": [
379
+ {
380
+ "keyword": "Then ",
381
+ "name": "I think it means \"fast\"",
382
+ "line": 8
383
+ }
384
+ ]
385
+ }
386
+ ]
387
+ }
388
+ ]
332
389
  """
333
390
 
334
391
  Scenario: Feature with a description
@@ -347,21 +404,21 @@ Feature: JSON formatter
347
404
 
348
405
  some pre-formatted stuff
349
406
 
350
- Background: name
407
+ Background: b name
351
408
  test
352
409
  test
353
410
 
354
- Scenario: name
411
+ Scenario: s name
355
412
  test
356
413
  test
357
414
 
358
- Scenario Outline: name
415
+ Scenario Outline: s o name
359
416
  test
360
417
  test
361
418
 
362
419
  Given <foo>
363
420
 
364
- Examples: name
421
+ Examples: e name
365
422
  test
366
423
  test
367
424
  | foo |
@@ -369,64 +426,73 @@ Feature: JSON formatter
369
426
  """
370
427
  Then the outputted JSON should be:
371
428
  """
372
- {
373
- "keyword": "Feature",
374
- "name": "Foo",
375
- "description": "one line \nanother line \n\n some pre-formatted stuff",
376
- "line": 1,
377
- "elements": [
378
- {
379
- "description": " test \n test",
380
- "keyword": "Background",
381
- "line": 7,
382
- "name": "name",
383
- "type": "background"
384
- },
385
- {
386
- "description": " test \n test",
387
- "keyword": "Scenario",
388
- "line": 11,
389
- "name": "name",
390
- "type": "scenario"
391
- },
392
- {
393
- "description": " test \n test",
394
- "examples": [
395
- {
396
- "description": " test \n test",
397
- "keyword": "Examples",
398
- "line": 21,
399
- "name": "name",
400
- "rows": [
401
- {
402
- "cells": [
403
- "foo"
404
- ],
405
- "line": 24
406
- },
407
- {
408
- "cells": [
409
- "table"
410
- ],
411
- "line": 25
412
- }
413
- ]
414
- }
415
- ],
416
- "keyword": "Scenario Outline",
417
- "line": 15,
418
- "name": "name",
419
- "steps": [
420
- {
421
- "keyword": "Given ",
422
- "line": 19,
423
- "name": "<foo>"
424
- }
425
- ],
426
- "type": "scenario_outline"
427
- }
428
- ]
429
- }
429
+ [
430
+ {
431
+ "uri": "test.feature",
432
+ "keyword": "Feature",
433
+ "id": "foo",
434
+ "name": "Foo",
435
+ "description": "one line \nanother line \n\n some pre-formatted stuff",
436
+ "line": 1,
437
+ "elements": [
438
+ {
439
+ "description": " test \n test",
440
+ "keyword": "Background",
441
+ "line": 7,
442
+ "name": "b name",
443
+ "type": "background"
444
+ },
445
+ {
446
+ "description": " test \n test",
447
+ "keyword": "Scenario",
448
+ "line": 11,
449
+ "id": "foo;s-name",
450
+ "name": "s name",
451
+ "type": "scenario"
452
+ },
453
+ {
454
+ "description": " test \n test",
455
+ "examples": [
456
+ {
457
+ "description": " test \n test",
458
+ "keyword": "Examples",
459
+ "line": 21,
460
+ "id": "foo;s-o-name;e-name",
461
+ "name": "e name",
462
+ "rows": [
463
+ {
464
+ "id": "foo;s-o-name;e-name;1",
465
+ "cells": [
466
+ "foo"
467
+ ],
468
+ "line": 24
469
+ },
470
+ {
471
+ "id": "foo;s-o-name;e-name;2",
472
+ "cells": [
473
+ "table"
474
+ ],
475
+ "line": 25
476
+ }
477
+ ]
478
+ }
479
+ ],
480
+ "keyword": "Scenario Outline",
481
+ "line": 15,
482
+ "id": "foo;s-o-name",
483
+ "name": "s o name",
484
+ "steps": [
485
+ {
486
+ "keyword": "Given ",
487
+ "line": 19,
488
+ "name": "<foo>"
489
+ }
490
+ ],
491
+ "type": "scenario_outline"
492
+ }
493
+ ]
494
+ }
495
+ ]
430
496
  """
431
497
 
432
498