cucumber 0.1.9 → 0.1.16
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/History.txt +143 -1
- data/Manifest.txt +56 -10
- data/README.txt +2 -39
- data/Rakefile +1 -2
- data/bin/cucumber +3 -2
- data/config/hoe.rb +2 -1
- data/examples/calculator_ruby_features/features/addition.rb +17 -1
- data/examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/cs/README.textile +1 -22
- data/examples/cs/Rakefile +1 -1
- data/examples/cs/compile.bat +1 -0
- data/examples/cs/features/addition.feature +17 -0
- data/examples/cs/features/step_definitons/calculator_steps.rb +23 -0
- data/examples/cs/src/demo/Calculator.cs +20 -0
- data/examples/i18n/Rakefile +18 -2
- data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +3 -1
- data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +3 -1
- data/examples/i18n/de/Rakefile +6 -0
- data/examples/i18n/de/features/addition.feature +17 -0
- data/examples/i18n/de/features/division.feature +10 -0
- data/examples/i18n/de/features/step_definitons/calculator_steps.rb +32 -0
- data/examples/i18n/de/lib/calculator.rb +14 -0
- data/examples/i18n/en/Rakefile +1 -0
- data/examples/i18n/en/features/step_definitons/calculator_steps.rb +3 -6
- data/examples/i18n/es/features/step_definitons/calculador_steps.rb +3 -1
- data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +3 -1
- data/examples/i18n/fr/features/addition.feature +13 -11
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +8 -3
- data/examples/i18n/id/features/step_definitons/calculator_steps.rb +3 -1
- data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +3 -1
- data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +4 -1
- data/examples/i18n/ko/Rakefile +6 -0
- data/examples/i18n/ko/features/addition.feature +17 -0
- data/examples/i18n/ko/features/division.feature +11 -0
- data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +28 -0
- data/examples/i18n/ko/lib/calculator.rb +14 -0
- data/examples/i18n/lt/Rakefile +6 -0
- data/examples/i18n/lt/features/addition.feature +17 -0
- data/examples/i18n/lt/features/division.feature +10 -0
- data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +33 -0
- data/examples/i18n/lt/lib/calculator.rb +14 -0
- data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +3 -1
- data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +3 -1
- data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +3 -1
- data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +3 -1
- data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +3 -1
- data/examples/java/features/step_definitons/hello_steps.rb +1 -1
- data/examples/java/features/step_definitons/tree_steps.rb +1 -1
- data/examples/selenium/features/search.feature +1 -1
- data/examples/selenium/features/step_definitons/stories_steps.rb +3 -4
- data/examples/self_test/README.textile +3 -0
- data/examples/self_test/features/outline_sample.feature +9 -0
- data/examples/self_test/features/sample.feature +14 -0
- data/examples/self_test/features/step_definitions/sample_steps.rb +13 -0
- data/examples/test_unit/Rakefile +6 -0
- data/examples/test_unit/features/step_definitions/test_unit_steps.rb +26 -0
- data/examples/test_unit/features/test_unit.feature +9 -0
- data/examples/tickets/features/lib/eatting_machine.rb +18 -0
- data/examples/tickets/features/lib/pantry.rb +20 -0
- data/examples/tickets/features/scenario_outline.feature +90 -0
- data/examples/tickets/features/step_definitons/scenario_outline_steps.rb +42 -0
- data/examples/tickets/features/step_definitons/tickets_steps.rb +5 -1
- data/examples/tickets/features/tickets.feature +4 -2
- data/examples/watir/README.textile +16 -0
- data/examples/watir/features/step_definitons/search_steps.rb +24 -0
- data/examples/watir/features/support/env.rb +32 -0
- data/features/cucumber_cli.feature +223 -0
- data/features/cucumber_cli_outlines.feature +73 -0
- data/features/step_definitions/cucumber_steps.rb +27 -0
- data/features/step_definitions/extra_steps.rb +2 -0
- data/features/support/env.rb +7 -0
- data/gem_tasks/deployment.rake +0 -23
- data/gem_tasks/fix_cr_lf.rake +1 -1
- data/gem_tasks/gemspec.rake +4 -0
- data/gem_tasks/rspec.rake +29 -15
- data/gem_tasks/treetop.rake +1 -1
- data/gem_tasks/yard.rake +8 -0
- data/lib/autotest/cucumber_mixin.rb +30 -9
- data/lib/autotest/discover.rb +1 -1
- data/lib/cucumber/broadcaster.rb +1 -1
- data/lib/cucumber/cli.rb +139 -52
- data/lib/cucumber/core_ext/exception.rb +20 -0
- data/lib/cucumber/core_ext/proc.rb +31 -16
- data/lib/cucumber/core_ext/string.rb +7 -0
- data/lib/cucumber/executor.rb +62 -27
- data/lib/cucumber/formatters/ansicolor.rb +80 -86
- data/lib/cucumber/formatters/html_formatter.rb +33 -10
- data/lib/cucumber/formatters/pretty_formatter.rb +73 -22
- data/lib/cucumber/formatters/progress_formatter.rb +3 -0
- data/lib/cucumber/formatters/unicode.rb +35 -0
- data/lib/cucumber/languages.yml +43 -5
- data/lib/cucumber/model/table.rb +5 -1
- data/lib/cucumber/platform.rb +32 -0
- data/lib/cucumber/rails/rspec.rb +1 -1
- data/lib/cucumber/rails/world.rb +7 -7
- data/lib/cucumber/rake/task.rb +7 -2
- data/lib/cucumber/step_mother.rb +11 -2
- data/lib/cucumber/tree/feature.rb +47 -3
- data/lib/cucumber/tree/scenario.rb +85 -3
- data/lib/cucumber/tree/step.rb +41 -2
- data/lib/cucumber/tree.rb +0 -2
- data/lib/cucumber/treetop_parser/feature.treetop.erb +55 -7
- data/lib/cucumber/treetop_parser/feature_ar.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_cy.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_da.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_de.rb +386 -26
- data/lib/cucumber/treetop_parser/feature_en-lol.rb +1951 -0
- data/lib/cucumber/treetop_parser/feature_en-tx.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_en.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_es.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_et.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_fr.rb +390 -30
- data/lib/cucumber/treetop_parser/feature_id.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_it.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_ja.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_ko.rb +1951 -0
- data/lib/cucumber/treetop_parser/feature_lt.rb +1951 -0
- data/lib/cucumber/treetop_parser/feature_nl.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_no.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_parser.rb +3 -1
- data/lib/cucumber/treetop_parser/feature_pl.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_pt.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_ro.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_ro2.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_ru.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_se.rb +378 -18
- data/lib/cucumber/treetop_parser/feature_zh-CN.rb +378 -18
- data/lib/cucumber/version.rb +3 -2
- data/lib/cucumber/world/pending.rb +22 -0
- data/lib/cucumber/world.rb +1 -0
- data/lib/cucumber.rb +4 -24
- data/rails_generators/cucumber/cucumber_generator.rb +1 -0
- data/rails_generators/cucumber/templates/env.rb +9 -1
- data/rails_generators/cucumber/templates/paths.rb +12 -0
- data/rails_generators/cucumber/templates/webrat_steps.rb +61 -8
- data/rails_generators/feature/feature_generator.rb +22 -2
- data/rails_generators/feature/templates/feature.erb +18 -15
- data/rails_generators/feature/templates/steps.erb +16 -14
- data/spec/cucumber/cli_spec.rb +285 -6
- data/spec/cucumber/executor_spec.rb +202 -42
- data/spec/cucumber/formatters/ansicolor_spec.rb +10 -10
- data/spec/cucumber/formatters/html_formatter_spec.rb +30 -0
- data/spec/cucumber/formatters/pretty_formatter_spec.rb +211 -5
- data/spec/cucumber/formatters/profile_formatter_spec.rb +5 -0
- data/spec/cucumber/formatters/progress_formatter_spec.rb +16 -0
- data/spec/cucumber/model/table_spec.rb +17 -5
- data/spec/cucumber/rails/stubs/mini_rails.rb +4 -3
- data/spec/cucumber/step_mother_spec.rb +7 -7
- data/spec/cucumber/tree/feature_spec.rb +110 -0
- data/spec/cucumber/tree/row_scenario_outline_spec.rb +73 -0
- data/spec/cucumber/tree/row_scenario_spec.rb +30 -0
- data/spec/cucumber/tree/row_step_outline_spec.rb +38 -0
- data/spec/cucumber/tree/scenario_outline_spec.rb +50 -0
- data/spec/cucumber/tree/scenario_spec.rb +58 -0
- data/spec/cucumber/tree/step_outline_spec.rb +17 -0
- data/spec/cucumber/tree/step_spec.rb +9 -0
- data/spec/cucumber/treetop_parser/empty_scenario_outline.feature +3 -0
- data/spec/cucumber/treetop_parser/feature_parser_spec.rb +22 -0
- data/spec/cucumber/treetop_parser/invalid_scenario_outlines.feature +7 -0
- data/spec/cucumber/treetop_parser/scenario_outline.feature +16 -0
- data/spec/cucumber/world/pending_spec.rb +46 -0
- data/spec/spec_helper.rb +4 -2
- metadata +59 -24
- data/TODO.txt +0 -26
- data/examples/cs/features/hello.feature +0 -11
- data/examples/cs/features/step_definitons/hello_steps.rb +0 -25
- data/examples/cs/features/step_definitons/tree_steps.rb +0 -14
- data/examples/cs/features/tree.feature +0 -9
- data/examples/cs/src/Hello.cs +0 -18
- data/examples/java/src/cucumber/demo/Hello.java +0 -16
- data/examples/watir/features/step_definitons/stories_steps.rb +0 -51
- data/features/see_features.feature +0 -8
- data/features/steps/features_steps.rb +0 -9
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
1
2
|
module Cucumber
|
|
2
3
|
# :stopdoc:
|
|
3
4
|
module TreetopParser
|
|
@@ -94,12 +95,17 @@ module Feature
|
|
|
94
95
|
if r4
|
|
95
96
|
r3 = r4
|
|
96
97
|
else
|
|
97
|
-
r5 =
|
|
98
|
+
r5 = _nt_scenario_outline_keyword
|
|
98
99
|
if r5
|
|
99
100
|
r3 = r5
|
|
100
101
|
else
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
r6 = _nt_comment_to_eol
|
|
103
|
+
if r6
|
|
104
|
+
r3 = r6
|
|
105
|
+
else
|
|
106
|
+
self.index = i3
|
|
107
|
+
r3 = nil
|
|
108
|
+
end
|
|
103
109
|
end
|
|
104
110
|
end
|
|
105
111
|
if r3
|
|
@@ -111,13 +117,13 @@ module Feature
|
|
|
111
117
|
s1 << r2
|
|
112
118
|
if r2
|
|
113
119
|
if index < input_length
|
|
114
|
-
|
|
120
|
+
r7 = (SyntaxNode).new(input, index...(index + 1))
|
|
115
121
|
@index += 1
|
|
116
122
|
else
|
|
117
123
|
terminal_parse_failure("any character")
|
|
118
|
-
|
|
124
|
+
r7 = nil
|
|
119
125
|
end
|
|
120
|
-
s1 <<
|
|
126
|
+
s1 << r7
|
|
121
127
|
end
|
|
122
128
|
if s1.last
|
|
123
129
|
r1 = (SyntaxNode).new(input, i1...index, s1)
|
|
@@ -149,7 +155,7 @@ module Feature
|
|
|
149
155
|
elements[0]
|
|
150
156
|
end
|
|
151
157
|
|
|
152
|
-
def
|
|
158
|
+
def scenario_or_scenario_outline_or_table
|
|
153
159
|
elements[1]
|
|
154
160
|
end
|
|
155
161
|
end
|
|
@@ -166,13 +172,13 @@ module Feature
|
|
|
166
172
|
|
|
167
173
|
module ScenarioSequence2
|
|
168
174
|
def compile(feature)
|
|
169
|
-
([head] + tail).each do |
|
|
170
|
-
|
|
175
|
+
([head] + tail).each do |scenario_or_scenario_outline_or_table|
|
|
176
|
+
scenario_or_scenario_outline_or_table.compile(feature) if scenario_or_scenario_outline_or_table.respond_to?(:compile)
|
|
171
177
|
end
|
|
172
178
|
end
|
|
173
179
|
|
|
174
180
|
def tail
|
|
175
|
-
super.elements.map { |elt| elt.
|
|
181
|
+
super.elements.map { |elt| elt.scenario_or_scenario_outline_or_table }
|
|
176
182
|
end
|
|
177
183
|
end
|
|
178
184
|
|
|
@@ -185,7 +191,7 @@ module Feature
|
|
|
185
191
|
end
|
|
186
192
|
|
|
187
193
|
i0, s0 = index, []
|
|
188
|
-
r2 =
|
|
194
|
+
r2 = _nt_scenario_outline_or_scenario
|
|
189
195
|
if r2
|
|
190
196
|
r1 = r2
|
|
191
197
|
else
|
|
@@ -199,7 +205,7 @@ module Feature
|
|
|
199
205
|
r5 = _nt_space
|
|
200
206
|
s4 << r5
|
|
201
207
|
if r5
|
|
202
|
-
r6 =
|
|
208
|
+
r6 = _nt_scenario_or_scenario_outline_or_table
|
|
203
209
|
s4 << r6
|
|
204
210
|
end
|
|
205
211
|
if s4.last
|
|
@@ -232,6 +238,33 @@ module Feature
|
|
|
232
238
|
return r0
|
|
233
239
|
end
|
|
234
240
|
|
|
241
|
+
def _nt_scenario_outline_or_scenario
|
|
242
|
+
start_index = index
|
|
243
|
+
if node_cache[:scenario_outline_or_scenario].has_key?(index)
|
|
244
|
+
cached = node_cache[:scenario_outline_or_scenario][index]
|
|
245
|
+
@index = cached.interval.end if cached
|
|
246
|
+
return cached
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
i0 = index
|
|
250
|
+
r1 = _nt_scenario_outline
|
|
251
|
+
if r1
|
|
252
|
+
r0 = r1
|
|
253
|
+
else
|
|
254
|
+
r2 = _nt_scenario
|
|
255
|
+
if r2
|
|
256
|
+
r0 = r2
|
|
257
|
+
else
|
|
258
|
+
self.index = i0
|
|
259
|
+
r0 = nil
|
|
260
|
+
end
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
node_cache[:scenario_outline_or_scenario][start_index] = r0
|
|
264
|
+
|
|
265
|
+
return r0
|
|
266
|
+
end
|
|
267
|
+
|
|
235
268
|
module Scenario0
|
|
236
269
|
def space
|
|
237
270
|
elements[0]
|
|
@@ -327,20 +360,102 @@ module Feature
|
|
|
327
360
|
return r0
|
|
328
361
|
end
|
|
329
362
|
|
|
330
|
-
|
|
363
|
+
module ScenarioOutline0
|
|
364
|
+
def scenario_outline_keyword
|
|
365
|
+
elements[0]
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
def name
|
|
369
|
+
elements[2]
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
def outline_body
|
|
373
|
+
elements[3]
|
|
374
|
+
end
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
module ScenarioOutline1
|
|
378
|
+
def compile(feature)
|
|
379
|
+
line = input.line_of(interval.first)
|
|
380
|
+
scenario = feature.add_scenario_outline(name.text_value.strip, line)
|
|
381
|
+
Feature.last_scenario = scenario
|
|
382
|
+
outline_body.compile(feature, scenario) if outline_body.respond_to?(:compile)
|
|
383
|
+
end
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
def _nt_scenario_outline
|
|
331
387
|
start_index = index
|
|
332
|
-
if node_cache[:
|
|
333
|
-
cached = node_cache[:
|
|
388
|
+
if node_cache[:scenario_outline].has_key?(index)
|
|
389
|
+
cached = node_cache[:scenario_outline][index]
|
|
390
|
+
@index = cached.interval.end if cached
|
|
391
|
+
return cached
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
i0, s0 = index, []
|
|
395
|
+
r1 = _nt_scenario_outline_keyword
|
|
396
|
+
s0 << r1
|
|
397
|
+
if r1
|
|
398
|
+
r3 = _nt_space
|
|
399
|
+
if r3
|
|
400
|
+
r2 = r3
|
|
401
|
+
else
|
|
402
|
+
r2 = SyntaxNode.new(input, index...index)
|
|
403
|
+
end
|
|
404
|
+
s0 << r2
|
|
405
|
+
if r2
|
|
406
|
+
r4 = _nt_line_to_eol
|
|
407
|
+
s0 << r4
|
|
408
|
+
if r4
|
|
409
|
+
r6 = _nt_steps_and_optional_examples
|
|
410
|
+
if r6
|
|
411
|
+
r5 = r6
|
|
412
|
+
else
|
|
413
|
+
r5 = SyntaxNode.new(input, index...index)
|
|
414
|
+
end
|
|
415
|
+
s0 << r5
|
|
416
|
+
end
|
|
417
|
+
end
|
|
418
|
+
end
|
|
419
|
+
if s0.last
|
|
420
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
|
421
|
+
r0.extend(ScenarioOutline0)
|
|
422
|
+
r0.extend(ScenarioOutline1)
|
|
423
|
+
else
|
|
424
|
+
self.index = i0
|
|
425
|
+
r0 = nil
|
|
426
|
+
end
|
|
427
|
+
|
|
428
|
+
node_cache[:scenario_outline][start_index] = r0
|
|
429
|
+
|
|
430
|
+
return r0
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
def _nt_scenario_or_scenario_outline_or_table
|
|
434
|
+
start_index = index
|
|
435
|
+
if node_cache[:scenario_or_scenario_outline_or_table].has_key?(index)
|
|
436
|
+
cached = node_cache[:scenario_or_scenario_outline_or_table][index]
|
|
334
437
|
@index = cached.interval.end if cached
|
|
335
438
|
return cached
|
|
336
439
|
end
|
|
337
440
|
|
|
338
441
|
i0 = index
|
|
339
|
-
r1 =
|
|
442
|
+
r1 = _nt_scenario_outline
|
|
340
443
|
if r1
|
|
341
444
|
r0 = r1
|
|
342
445
|
else
|
|
343
|
-
|
|
446
|
+
i2 = index
|
|
447
|
+
r3 = _nt_scenario
|
|
448
|
+
if r3
|
|
449
|
+
r2 = r3
|
|
450
|
+
else
|
|
451
|
+
r4 = _nt_more_examples
|
|
452
|
+
if r4
|
|
453
|
+
r2 = r4
|
|
454
|
+
else
|
|
455
|
+
self.index = i2
|
|
456
|
+
r2 = nil
|
|
457
|
+
end
|
|
458
|
+
end
|
|
344
459
|
if r2
|
|
345
460
|
r0 = r2
|
|
346
461
|
else
|
|
@@ -349,7 +464,104 @@ module Feature
|
|
|
349
464
|
end
|
|
350
465
|
end
|
|
351
466
|
|
|
352
|
-
node_cache[:
|
|
467
|
+
node_cache[:scenario_or_scenario_outline_or_table][start_index] = r0
|
|
468
|
+
|
|
469
|
+
return r0
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
module StepsAndOptionalExamples0
|
|
473
|
+
def space
|
|
474
|
+
elements[0]
|
|
475
|
+
end
|
|
476
|
+
|
|
477
|
+
def step_sequence
|
|
478
|
+
elements[1]
|
|
479
|
+
end
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
module StepsAndOptionalExamples1
|
|
483
|
+
def space
|
|
484
|
+
elements[0]
|
|
485
|
+
end
|
|
486
|
+
|
|
487
|
+
def examples
|
|
488
|
+
elements[1]
|
|
489
|
+
end
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
module StepsAndOptionalExamples2
|
|
493
|
+
def steps
|
|
494
|
+
elements[0]
|
|
495
|
+
end
|
|
496
|
+
|
|
497
|
+
def table
|
|
498
|
+
elements[1]
|
|
499
|
+
end
|
|
500
|
+
end
|
|
501
|
+
|
|
502
|
+
module StepsAndOptionalExamples3
|
|
503
|
+
def compile(feature, scenario)
|
|
504
|
+
steps.step_sequence.compile(scenario) if steps.respond_to?(:step_sequence)
|
|
505
|
+
table.examples.compile(feature, scenario) if table.respond_to?(:examples) && table.examples.respond_to?(:compile)
|
|
506
|
+
end
|
|
507
|
+
end
|
|
508
|
+
|
|
509
|
+
def _nt_steps_and_optional_examples
|
|
510
|
+
start_index = index
|
|
511
|
+
if node_cache[:steps_and_optional_examples].has_key?(index)
|
|
512
|
+
cached = node_cache[:steps_and_optional_examples][index]
|
|
513
|
+
@index = cached.interval.end if cached
|
|
514
|
+
return cached
|
|
515
|
+
end
|
|
516
|
+
|
|
517
|
+
i0, s0 = index, []
|
|
518
|
+
i1, s1 = index, []
|
|
519
|
+
r2 = _nt_space
|
|
520
|
+
s1 << r2
|
|
521
|
+
if r2
|
|
522
|
+
r3 = _nt_step_sequence
|
|
523
|
+
s1 << r3
|
|
524
|
+
end
|
|
525
|
+
if s1.last
|
|
526
|
+
r1 = (SyntaxNode).new(input, i1...index, s1)
|
|
527
|
+
r1.extend(StepsAndOptionalExamples0)
|
|
528
|
+
else
|
|
529
|
+
self.index = i1
|
|
530
|
+
r1 = nil
|
|
531
|
+
end
|
|
532
|
+
s0 << r1
|
|
533
|
+
if r1
|
|
534
|
+
i5, s5 = index, []
|
|
535
|
+
r6 = _nt_space
|
|
536
|
+
s5 << r6
|
|
537
|
+
if r6
|
|
538
|
+
r7 = _nt_examples
|
|
539
|
+
s5 << r7
|
|
540
|
+
end
|
|
541
|
+
if s5.last
|
|
542
|
+
r5 = (SyntaxNode).new(input, i5...index, s5)
|
|
543
|
+
r5.extend(StepsAndOptionalExamples1)
|
|
544
|
+
else
|
|
545
|
+
self.index = i5
|
|
546
|
+
r5 = nil
|
|
547
|
+
end
|
|
548
|
+
if r5
|
|
549
|
+
r4 = r5
|
|
550
|
+
else
|
|
551
|
+
r4 = SyntaxNode.new(input, index...index)
|
|
552
|
+
end
|
|
553
|
+
s0 << r4
|
|
554
|
+
end
|
|
555
|
+
if s0.last
|
|
556
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
|
557
|
+
r0.extend(StepsAndOptionalExamples2)
|
|
558
|
+
r0.extend(StepsAndOptionalExamples3)
|
|
559
|
+
else
|
|
560
|
+
self.index = i0
|
|
561
|
+
r0 = nil
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
node_cache[:steps_and_optional_examples][start_index] = r0
|
|
353
565
|
|
|
354
566
|
return r0
|
|
355
567
|
end
|
|
@@ -399,6 +611,51 @@ module Feature
|
|
|
399
611
|
return r0
|
|
400
612
|
end
|
|
401
613
|
|
|
614
|
+
module Examples0
|
|
615
|
+
def examples_keyword
|
|
616
|
+
elements[0]
|
|
617
|
+
end
|
|
618
|
+
|
|
619
|
+
def table
|
|
620
|
+
elements[1]
|
|
621
|
+
end
|
|
622
|
+
end
|
|
623
|
+
|
|
624
|
+
module Examples1
|
|
625
|
+
def compile(feature, scenario)
|
|
626
|
+
table.compile_examples(feature, scenario)
|
|
627
|
+
end
|
|
628
|
+
end
|
|
629
|
+
|
|
630
|
+
def _nt_examples
|
|
631
|
+
start_index = index
|
|
632
|
+
if node_cache[:examples].has_key?(index)
|
|
633
|
+
cached = node_cache[:examples][index]
|
|
634
|
+
@index = cached.interval.end if cached
|
|
635
|
+
return cached
|
|
636
|
+
end
|
|
637
|
+
|
|
638
|
+
i0, s0 = index, []
|
|
639
|
+
r1 = _nt_examples_keyword
|
|
640
|
+
s0 << r1
|
|
641
|
+
if r1
|
|
642
|
+
r2 = _nt_table
|
|
643
|
+
s0 << r2
|
|
644
|
+
end
|
|
645
|
+
if s0.last
|
|
646
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
|
647
|
+
r0.extend(Examples0)
|
|
648
|
+
r0.extend(Examples1)
|
|
649
|
+
else
|
|
650
|
+
self.index = i0
|
|
651
|
+
r0 = nil
|
|
652
|
+
end
|
|
653
|
+
|
|
654
|
+
node_cache[:examples][start_index] = r0
|
|
655
|
+
|
|
656
|
+
return r0
|
|
657
|
+
end
|
|
658
|
+
|
|
402
659
|
module Table0
|
|
403
660
|
def eol
|
|
404
661
|
elements[1]
|
|
@@ -431,6 +688,13 @@ module Feature
|
|
|
431
688
|
end
|
|
432
689
|
end
|
|
433
690
|
|
|
691
|
+
def compile_examples(feature, scenario)
|
|
692
|
+
scenario.table_header = head.cell_values
|
|
693
|
+
body.each do |table_line|
|
|
694
|
+
feature.add_row_scenario_outline(scenario, table_line.cell_values, table_line.line)
|
|
695
|
+
end
|
|
696
|
+
end
|
|
697
|
+
|
|
434
698
|
def matrix
|
|
435
699
|
([head] + body).map do |table_line|
|
|
436
700
|
table_line.cell_values # We're losing the line - we'll get it back when we make our own class
|
|
@@ -1484,6 +1748,54 @@ module Feature
|
|
|
1484
1748
|
return r0
|
|
1485
1749
|
end
|
|
1486
1750
|
|
|
1751
|
+
module ScenarioOutlineKeyword0
|
|
1752
|
+
end
|
|
1753
|
+
|
|
1754
|
+
def _nt_scenario_outline_keyword
|
|
1755
|
+
start_index = index
|
|
1756
|
+
if node_cache[:scenario_outline_keyword].has_key?(index)
|
|
1757
|
+
cached = node_cache[:scenario_outline_keyword][index]
|
|
1758
|
+
@index = cached.interval.end if cached
|
|
1759
|
+
return cached
|
|
1760
|
+
end
|
|
1761
|
+
|
|
1762
|
+
i0, s0 = index, []
|
|
1763
|
+
if input.index("Scenario Outline", index) == index
|
|
1764
|
+
r1 = (SyntaxNode).new(input, index...(index + 16))
|
|
1765
|
+
@index += 16
|
|
1766
|
+
else
|
|
1767
|
+
terminal_parse_failure("Scenario Outline")
|
|
1768
|
+
r1 = nil
|
|
1769
|
+
end
|
|
1770
|
+
s0 << r1
|
|
1771
|
+
if r1
|
|
1772
|
+
if input.index(":", index) == index
|
|
1773
|
+
r3 = (SyntaxNode).new(input, index...(index + 1))
|
|
1774
|
+
@index += 1
|
|
1775
|
+
else
|
|
1776
|
+
terminal_parse_failure(":")
|
|
1777
|
+
r3 = nil
|
|
1778
|
+
end
|
|
1779
|
+
if r3
|
|
1780
|
+
r2 = r3
|
|
1781
|
+
else
|
|
1782
|
+
r2 = SyntaxNode.new(input, index...index)
|
|
1783
|
+
end
|
|
1784
|
+
s0 << r2
|
|
1785
|
+
end
|
|
1786
|
+
if s0.last
|
|
1787
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
|
1788
|
+
r0.extend(ScenarioOutlineKeyword0)
|
|
1789
|
+
else
|
|
1790
|
+
self.index = i0
|
|
1791
|
+
r0 = nil
|
|
1792
|
+
end
|
|
1793
|
+
|
|
1794
|
+
node_cache[:scenario_outline_keyword][start_index] = r0
|
|
1795
|
+
|
|
1796
|
+
return r0
|
|
1797
|
+
end
|
|
1798
|
+
|
|
1487
1799
|
module MoreExamplesKeyword0
|
|
1488
1800
|
end
|
|
1489
1801
|
|
|
@@ -1532,6 +1844,54 @@ module Feature
|
|
|
1532
1844
|
return r0
|
|
1533
1845
|
end
|
|
1534
1846
|
|
|
1847
|
+
module ExamplesKeyword0
|
|
1848
|
+
end
|
|
1849
|
+
|
|
1850
|
+
def _nt_examples_keyword
|
|
1851
|
+
start_index = index
|
|
1852
|
+
if node_cache[:examples_keyword].has_key?(index)
|
|
1853
|
+
cached = node_cache[:examples_keyword][index]
|
|
1854
|
+
@index = cached.interval.end if cached
|
|
1855
|
+
return cached
|
|
1856
|
+
end
|
|
1857
|
+
|
|
1858
|
+
i0, s0 = index, []
|
|
1859
|
+
if input.index("Examples", index) == index
|
|
1860
|
+
r1 = (SyntaxNode).new(input, index...(index + 8))
|
|
1861
|
+
@index += 8
|
|
1862
|
+
else
|
|
1863
|
+
terminal_parse_failure("Examples")
|
|
1864
|
+
r1 = nil
|
|
1865
|
+
end
|
|
1866
|
+
s0 << r1
|
|
1867
|
+
if r1
|
|
1868
|
+
if input.index(":", index) == index
|
|
1869
|
+
r3 = (SyntaxNode).new(input, index...(index + 1))
|
|
1870
|
+
@index += 1
|
|
1871
|
+
else
|
|
1872
|
+
terminal_parse_failure(":")
|
|
1873
|
+
r3 = nil
|
|
1874
|
+
end
|
|
1875
|
+
if r3
|
|
1876
|
+
r2 = r3
|
|
1877
|
+
else
|
|
1878
|
+
r2 = SyntaxNode.new(input, index...index)
|
|
1879
|
+
end
|
|
1880
|
+
s0 << r2
|
|
1881
|
+
end
|
|
1882
|
+
if s0.last
|
|
1883
|
+
r0 = (SyntaxNode).new(input, i0...index, s0)
|
|
1884
|
+
r0.extend(ExamplesKeyword0)
|
|
1885
|
+
else
|
|
1886
|
+
self.index = i0
|
|
1887
|
+
r0 = nil
|
|
1888
|
+
end
|
|
1889
|
+
|
|
1890
|
+
node_cache[:examples_keyword][start_index] = r0
|
|
1891
|
+
|
|
1892
|
+
return r0
|
|
1893
|
+
end
|
|
1894
|
+
|
|
1535
1895
|
module GivenScenarioKeyword0
|
|
1536
1896
|
end
|
|
1537
1897
|
|