kosmas58-cucumber 0.2.2.1 → 0.2.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +57 -5
- data/Manifest.txt +21 -4
- data/bin/cucumber +1 -1
- data/config/hoe.rb +2 -2
- data/examples/i18n/Rakefile +6 -8
- data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/ar/lib/calculator.rb +1 -0
- data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +1 -1
- data/examples/i18n/de/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/en/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/es/features/step_definitons/calculador_steps.rb +1 -1
- data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +1 -1
- data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +1 -1
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +1 -1
- data/examples/i18n/id/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +1 -1
- data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/ko/features/addition.feature +1 -1
- data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/no/features/support/env.rb +1 -1
- data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +1 -1
- data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/ru/features/support/env.rb +1 -1
- data/examples/i18n/ru/features/support/world.rb +4 -3
- data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +1 -1
- data/examples/i18n/sk/Rakefile +6 -0
- data/examples/i18n/sk/features/addition.feature +16 -0
- data/examples/i18n/sk/features/division.feature +9 -0
- data/examples/i18n/sk/features/step_definitons/calculator_steps.rb +24 -0
- data/examples/i18n/sk/lib/calculator.rb +14 -0
- data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/zh-TW/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/self_test/features/background/background_with_name.feature +7 -0
- data/examples/self_test/features/step_definitions/sample_steps.rb +8 -2
- data/examples/self_test/features/undefined_multiline_args.feature +12 -0
- data/examples/sinatra/features/support/env.rb +2 -6
- data/examples/test_unit/features/step_definitions/test_unit_steps.rb +1 -4
- data/examples/tickets/Rakefile +1 -1
- data/examples/tickets/features/246.feature +4 -0
- data/examples/tickets/features/270/back.feature +14 -0
- data/examples/tickets/features/270/back.steps.rb +14 -0
- data/examples/tickets/features/step_definitons/246_steps.rb +3 -0
- data/features/background.feature +21 -4
- data/features/cucumber_cli.feature +18 -5
- data/features/cucumber_cli_outlines.feature +5 -2
- data/features/snippet.feature +23 -0
- data/features/step_definitions/cucumber_steps.rb +6 -2
- data/features/usage.feature +5 -0
- data/gem_tasks/rspec.rake +3 -2
- data/lib/cucumber/ast/background.rb +3 -3
- data/lib/cucumber/ast/examples.rb +0 -12
- data/lib/cucumber/ast/feature.rb +2 -12
- data/lib/cucumber/ast/feature_element.rb +0 -8
- data/lib/cucumber/ast/features.rb +1 -1
- data/lib/cucumber/ast/outline_table.rb +14 -22
- data/lib/cucumber/ast/py_string.rb +6 -11
- data/lib/cucumber/ast/scenario.rb +1 -8
- data/lib/cucumber/ast/scenario_outline.rb +1 -11
- data/lib/cucumber/ast/step.rb +3 -9
- data/lib/cucumber/ast/step_collection.rb +0 -4
- data/lib/cucumber/ast/step_invocation.rb +5 -6
- data/lib/cucumber/ast/table.rb +26 -22
- data/lib/cucumber/ast/tags.rb +0 -8
- data/lib/cucumber/ast/visitor.rb +12 -25
- data/lib/cucumber/cli/configuration.rb +2 -2
- data/lib/cucumber/cli/main.rb +5 -2
- data/lib/cucumber/core_ext/instance_exec.rb +17 -4
- data/lib/cucumber/formatter/ansicolor.rb +10 -2
- data/lib/cucumber/formatter/console.rb +2 -1
- data/lib/cucumber/formatter/html.rb +21 -7
- data/lib/cucumber/formatter/pretty.rb +27 -20
- data/lib/cucumber/formatter/usage.rb +16 -0
- data/lib/cucumber/languages.yml +68 -7
- data/lib/cucumber/parser/feature.rb +238 -135
- data/lib/cucumber/parser/feature.tt +117 -22
- data/lib/cucumber/parser/i18n.tt +4 -0
- data/lib/cucumber/parser/table.rb +37 -25
- data/lib/cucumber/parser/table.tt +15 -3
- data/lib/cucumber/parser/treetop_ext.rb +48 -9
- data/lib/cucumber/parser.rb +2 -7
- data/lib/cucumber/step_definition.rb +13 -14
- data/lib/cucumber/step_mother.rb +93 -11
- data/lib/cucumber/version.rb +2 -2
- data/rails_generators/cucumber/templates/env.rb +1 -1
- data/rails_generators/cucumber/templates/paths.rb +15 -5
- data/rails_generators/cucumber/templates/webrat_steps.rb +8 -0
- data/spec/cucumber/ast/background_spec.rb +1 -0
- data/spec/cucumber/ast/feature_factory.rb +1 -1
- data/spec/cucumber/ast/feature_spec.rb +2 -2
- data/spec/cucumber/ast/scenario_spec.rb +0 -27
- data/spec/cucumber/ast/table_spec.rb +23 -2
- data/spec/cucumber/core_ext/proc_spec.rb +25 -8
- data/spec/cucumber/parser/feature_parser_spec.rb +43 -41
- data/spec/cucumber/step_definition_spec.rb +8 -0
- data/spec/cucumber/step_mother_spec.rb +48 -0
- data/spec/spec_helper.rb +2 -11
- metadata +17 -6
- data/examples/tickets/cucumber.yml +0 -3
- data/lib/cucumber/parser/basic.rb +0 -0
- data/spec/cucumber/ast/tags_spec.rb +0 -19
@@ -56,15 +56,21 @@ module Cucumber
|
|
56
56
|
end
|
57
57
|
|
58
58
|
module Feature2
|
59
|
-
def
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
59
|
+
def has_tags?(tag_names)
|
60
|
+
tags.has_tags?(tag_names)
|
61
|
+
end
|
62
|
+
|
63
|
+
def build(filter)
|
64
|
+
if(filter.nil? || feature_elements.accept?(filter))
|
65
|
+
background = bg.respond_to?(:build) ? bg.build : nil
|
66
|
+
Ast::Feature.new(
|
67
|
+
background,
|
68
|
+
comment.build,
|
69
|
+
tags.build,
|
70
|
+
header.text_value,
|
71
|
+
feature_elements.build(background, filter)
|
72
|
+
)
|
73
|
+
end
|
68
74
|
end
|
69
75
|
end
|
70
76
|
|
@@ -118,12 +124,12 @@ module Cucumber
|
|
118
124
|
r8 = nil
|
119
125
|
else
|
120
126
|
self.index = i8
|
121
|
-
r8 = SyntaxNode
|
127
|
+
r8 = instantiate_node(SyntaxNode,input, index...index)
|
122
128
|
end
|
123
129
|
s7 << r8
|
124
130
|
if r8
|
125
131
|
if index < input_length
|
126
|
-
r13 = (SyntaxNode
|
132
|
+
r13 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
127
133
|
@index += 1
|
128
134
|
else
|
129
135
|
terminal_parse_failure("any character")
|
@@ -132,7 +138,7 @@ module Cucumber
|
|
132
138
|
s7 << r13
|
133
139
|
end
|
134
140
|
if s7.last
|
135
|
-
r7 = (SyntaxNode
|
141
|
+
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
136
142
|
r7.extend(Feature0)
|
137
143
|
else
|
138
144
|
self.index = i7
|
@@ -144,14 +150,14 @@ module Cucumber
|
|
144
150
|
break
|
145
151
|
end
|
146
152
|
end
|
147
|
-
r6 = SyntaxNode
|
153
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
148
154
|
s0 << r6
|
149
155
|
if r6
|
150
156
|
r15 = _nt_background
|
151
157
|
if r15
|
152
158
|
r14 = r15
|
153
159
|
else
|
154
|
-
r14 = SyntaxNode
|
160
|
+
r14 = instantiate_node(SyntaxNode,input, index...index)
|
155
161
|
end
|
156
162
|
s0 << r14
|
157
163
|
if r14
|
@@ -162,7 +168,7 @@ module Cucumber
|
|
162
168
|
if r18
|
163
169
|
r17 = r18
|
164
170
|
else
|
165
|
-
r17 = SyntaxNode
|
171
|
+
r17 = instantiate_node(SyntaxNode,input, index...index)
|
166
172
|
end
|
167
173
|
s0 << r17
|
168
174
|
end
|
@@ -174,7 +180,7 @@ module Cucumber
|
|
174
180
|
end
|
175
181
|
end
|
176
182
|
if s0.last
|
177
|
-
r0 = (SyntaxNode
|
183
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
178
184
|
r0.extend(Feature1)
|
179
185
|
r0.extend(Feature2)
|
180
186
|
else
|
@@ -205,10 +211,21 @@ module Cucumber
|
|
205
211
|
end
|
206
212
|
|
207
213
|
module Tags2
|
214
|
+
def at_line?(line)
|
215
|
+
ts.elements.detect{|e| e.tag.line == line}
|
216
|
+
end
|
217
|
+
|
218
|
+
def has_tags?(tags)
|
219
|
+
tag_names.detect{|tag_name| tags.index(tag_name)}
|
220
|
+
end
|
221
|
+
|
208
222
|
def build
|
209
|
-
tag_names = ts.elements.map{|e| e.tag.tag_name.text_value}
|
210
223
|
Ast::Tags.new(ts.line, tag_names)
|
211
224
|
end
|
225
|
+
|
226
|
+
def tag_names
|
227
|
+
ts.elements.map{|e| e.tag.tag_name.text_value}
|
228
|
+
end
|
212
229
|
end
|
213
230
|
|
214
231
|
def _nt_tags
|
@@ -254,12 +271,12 @@ module Cucumber
|
|
254
271
|
self.index = i5
|
255
272
|
r5 = nil
|
256
273
|
else
|
257
|
-
r5 = SyntaxNode
|
274
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
258
275
|
end
|
259
276
|
s3 << r5
|
260
277
|
end
|
261
278
|
if s3.last
|
262
|
-
r3 = (SyntaxNode
|
279
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
263
280
|
r3.extend(Tags0)
|
264
281
|
else
|
265
282
|
self.index = i3
|
@@ -271,11 +288,11 @@ module Cucumber
|
|
271
288
|
break
|
272
289
|
end
|
273
290
|
end
|
274
|
-
r2 = SyntaxNode
|
291
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
275
292
|
s0 << r2
|
276
293
|
end
|
277
294
|
if s0.last
|
278
|
-
r0 = (SyntaxNode
|
295
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
279
296
|
r0.extend(Tags1)
|
280
297
|
r0.extend(Tags2)
|
281
298
|
else
|
@@ -304,7 +321,7 @@ module Cucumber
|
|
304
321
|
|
305
322
|
i0, s0 = index, []
|
306
323
|
if input.index('@', index) == index
|
307
|
-
r1 = (SyntaxNode
|
324
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
308
325
|
@index += 1
|
309
326
|
else
|
310
327
|
terminal_parse_failure('@')
|
@@ -315,7 +332,7 @@ module Cucumber
|
|
315
332
|
s2, i2 = [], index
|
316
333
|
loop do
|
317
334
|
if input.index(Regexp.new('[^@\\r\\n\\t ]'), index) == index
|
318
|
-
r3 = (SyntaxNode
|
335
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
319
336
|
@index += 1
|
320
337
|
else
|
321
338
|
r3 = nil
|
@@ -330,12 +347,12 @@ module Cucumber
|
|
330
347
|
self.index = i2
|
331
348
|
r2 = nil
|
332
349
|
else
|
333
|
-
r2 = SyntaxNode
|
350
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
334
351
|
end
|
335
352
|
s0 << r2
|
336
353
|
end
|
337
354
|
if s0.last
|
338
|
-
r0 = (SyntaxNode
|
355
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
339
356
|
r0.extend(Tag0)
|
340
357
|
else
|
341
358
|
self.index = i0
|
@@ -381,7 +398,7 @@ module Cucumber
|
|
381
398
|
s1 << r3
|
382
399
|
end
|
383
400
|
if s1.last
|
384
|
-
r1 = (SyntaxNode
|
401
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
385
402
|
r1.extend(Comment0)
|
386
403
|
else
|
387
404
|
self.index = i1
|
@@ -393,7 +410,7 @@ module Cucumber
|
|
393
410
|
break
|
394
411
|
end
|
395
412
|
end
|
396
|
-
r0 = SyntaxNode
|
413
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
397
414
|
r0.extend(Comment1)
|
398
415
|
|
399
416
|
node_cache[:comment][start_index] = r0
|
@@ -417,7 +434,7 @@ module Cucumber
|
|
417
434
|
|
418
435
|
i0, s0 = index, []
|
419
436
|
if input.index('#', index) == index
|
420
|
-
r1 = (SyntaxNode
|
437
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
421
438
|
@index += 1
|
422
439
|
else
|
423
440
|
terminal_parse_failure('#')
|
@@ -429,7 +446,7 @@ module Cucumber
|
|
429
446
|
s0 << r2
|
430
447
|
end
|
431
448
|
if s0.last
|
432
|
-
r0 = (SyntaxNode
|
449
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
433
450
|
r0.extend(CommentLine0)
|
434
451
|
else
|
435
452
|
self.index = i0
|
@@ -454,8 +471,12 @@ module Cucumber
|
|
454
471
|
elements[2]
|
455
472
|
end
|
456
473
|
|
474
|
+
def name
|
475
|
+
elements[4]
|
476
|
+
end
|
477
|
+
|
457
478
|
def steps
|
458
|
-
elements[
|
479
|
+
elements[6]
|
459
480
|
end
|
460
481
|
end
|
461
482
|
|
@@ -464,7 +485,8 @@ module Cucumber
|
|
464
485
|
Ast::Background.new(
|
465
486
|
comment.build,
|
466
487
|
background_keyword.line,
|
467
|
-
background_keyword.text_value,
|
488
|
+
background_keyword.text_value,
|
489
|
+
name.text_value,
|
468
490
|
steps.build
|
469
491
|
)
|
470
492
|
end
|
@@ -497,47 +519,56 @@ module Cucumber
|
|
497
519
|
break
|
498
520
|
end
|
499
521
|
end
|
500
|
-
r4 = SyntaxNode
|
522
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
501
523
|
s0 << r4
|
502
524
|
if r4
|
503
|
-
|
504
|
-
s7, i7 = [], index
|
505
|
-
loop do
|
506
|
-
r8 = _nt_eol
|
507
|
-
if r8
|
508
|
-
s7 << r8
|
509
|
-
else
|
510
|
-
break
|
511
|
-
end
|
512
|
-
end
|
513
|
-
if s7.empty?
|
514
|
-
self.index = i7
|
515
|
-
r7 = nil
|
516
|
-
else
|
517
|
-
r7 = SyntaxNode.new(input, i7...index, s7)
|
518
|
-
end
|
525
|
+
r7 = _nt_line_to_eol
|
519
526
|
if r7
|
520
527
|
r6 = r7
|
521
528
|
else
|
522
|
-
|
523
|
-
if r9
|
524
|
-
r6 = r9
|
525
|
-
else
|
526
|
-
self.index = i6
|
527
|
-
r6 = nil
|
528
|
-
end
|
529
|
+
r6 = instantiate_node(SyntaxNode,input, index...index)
|
529
530
|
end
|
530
531
|
s0 << r6
|
531
532
|
if r6
|
532
|
-
|
533
|
-
|
533
|
+
i8 = index
|
534
|
+
s9, i9 = [], index
|
535
|
+
loop do
|
536
|
+
r10 = _nt_eol
|
537
|
+
if r10
|
538
|
+
s9 << r10
|
539
|
+
else
|
540
|
+
break
|
541
|
+
end
|
542
|
+
end
|
543
|
+
if s9.empty?
|
544
|
+
self.index = i9
|
545
|
+
r9 = nil
|
546
|
+
else
|
547
|
+
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
548
|
+
end
|
549
|
+
if r9
|
550
|
+
r8 = r9
|
551
|
+
else
|
552
|
+
r11 = _nt_eof
|
553
|
+
if r11
|
554
|
+
r8 = r11
|
555
|
+
else
|
556
|
+
self.index = i8
|
557
|
+
r8 = nil
|
558
|
+
end
|
559
|
+
end
|
560
|
+
s0 << r8
|
561
|
+
if r8
|
562
|
+
r12 = _nt_steps
|
563
|
+
s0 << r12
|
564
|
+
end
|
534
565
|
end
|
535
566
|
end
|
536
567
|
end
|
537
568
|
end
|
538
569
|
end
|
539
570
|
if s0.last
|
540
|
-
r0 = (SyntaxNode
|
571
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
541
572
|
r0.extend(Background0)
|
542
573
|
r0.extend(Background1)
|
543
574
|
else
|
@@ -551,8 +582,16 @@ module Cucumber
|
|
551
582
|
end
|
552
583
|
|
553
584
|
module FeatureElements0
|
554
|
-
def
|
555
|
-
elements.
|
585
|
+
def accept?(filter)
|
586
|
+
filter.nil? || elements.empty? || elements.detect{|feature_element| filter.accept?(feature_element)}
|
587
|
+
end
|
588
|
+
|
589
|
+
def build(background, filter)
|
590
|
+
elements.map do |feature_element|
|
591
|
+
if filter.nil? || filter.accept?(feature_element)
|
592
|
+
feature_element.build(background, filter)
|
593
|
+
end
|
594
|
+
end.compact
|
556
595
|
end
|
557
596
|
end
|
558
597
|
|
@@ -585,7 +624,7 @@ module Cucumber
|
|
585
624
|
break
|
586
625
|
end
|
587
626
|
end
|
588
|
-
r0 = SyntaxNode
|
627
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
589
628
|
r0.extend(FeatureElements0)
|
590
629
|
|
591
630
|
node_cache[:feature_elements][start_index] = r0
|
@@ -628,7 +667,22 @@ module Cucumber
|
|
628
667
|
end
|
629
668
|
|
630
669
|
module Scenario1
|
631
|
-
def
|
670
|
+
def at_line?(line)
|
671
|
+
scenario_keyword.line == line ||
|
672
|
+
steps.at_line?(line) ||
|
673
|
+
tags.at_line?(line)
|
674
|
+
end
|
675
|
+
|
676
|
+
def has_tags?(tag_names)
|
677
|
+
feature_tags = self.parent.parent.tags
|
678
|
+
tags.has_tags?(tag_names) || feature_tags.has_tags?(tag_names)
|
679
|
+
end
|
680
|
+
|
681
|
+
def matches_name?(name_to_match)
|
682
|
+
name.text_value == name_to_match
|
683
|
+
end
|
684
|
+
|
685
|
+
def build(background, filter)
|
632
686
|
Ast::Scenario.new(
|
633
687
|
background,
|
634
688
|
comment.build,
|
@@ -671,7 +725,7 @@ module Cucumber
|
|
671
725
|
break
|
672
726
|
end
|
673
727
|
end
|
674
|
-
r5 = SyntaxNode
|
728
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
675
729
|
s0 << r5
|
676
730
|
if r5
|
677
731
|
r7 = _nt_line_to_eol
|
@@ -694,7 +748,7 @@ module Cucumber
|
|
694
748
|
end
|
695
749
|
end
|
696
750
|
if s0.last
|
697
|
-
r0 = (SyntaxNode
|
751
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
698
752
|
r0.extend(Scenario0)
|
699
753
|
r0.extend(Scenario1)
|
700
754
|
else
|
@@ -746,7 +800,27 @@ module Cucumber
|
|
746
800
|
end
|
747
801
|
|
748
802
|
module ScenarioOutline1
|
749
|
-
def
|
803
|
+
def at_line?(line)
|
804
|
+
outline_at_line?(line) ||
|
805
|
+
examples_sections.at_line?(line) ||
|
806
|
+
tags.at_line?(line)
|
807
|
+
end
|
808
|
+
|
809
|
+
def outline_at_line?(line)
|
810
|
+
scenario_outline_keyword.line == line ||
|
811
|
+
steps.at_line?(line)
|
812
|
+
end
|
813
|
+
|
814
|
+
def has_tags?(tag_names)
|
815
|
+
feature_tags = self.parent.parent.tags
|
816
|
+
tags.has_tags?(tag_names) || feature_tags.has_tags?(tag_names)
|
817
|
+
end
|
818
|
+
|
819
|
+
def matches_name?(name_to_match)
|
820
|
+
name.text_value == name_to_match
|
821
|
+
end
|
822
|
+
|
823
|
+
def build(background, filter)
|
750
824
|
Ast::ScenarioOutline.new(
|
751
825
|
background,
|
752
826
|
comment.build,
|
@@ -755,7 +829,7 @@ module Cucumber
|
|
755
829
|
scenario_outline_keyword.text_value,
|
756
830
|
name.text_value,
|
757
831
|
steps.build,
|
758
|
-
examples_sections.build
|
832
|
+
examples_sections.build(filter, self)
|
759
833
|
)
|
760
834
|
end
|
761
835
|
end
|
@@ -790,7 +864,7 @@ module Cucumber
|
|
790
864
|
break
|
791
865
|
end
|
792
866
|
end
|
793
|
-
r5 = SyntaxNode
|
867
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
794
868
|
s0 << r5
|
795
869
|
if r5
|
796
870
|
r7 = _nt_line_to_eol
|
@@ -817,7 +891,7 @@ module Cucumber
|
|
817
891
|
end
|
818
892
|
end
|
819
893
|
if s0.last
|
820
|
-
r0 = (SyntaxNode
|
894
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
821
895
|
r0.extend(ScenarioOutline0)
|
822
896
|
r0.extend(ScenarioOutline1)
|
823
897
|
else
|
@@ -831,6 +905,10 @@ module Cucumber
|
|
831
905
|
end
|
832
906
|
|
833
907
|
module Steps0
|
908
|
+
def at_line?(line)
|
909
|
+
elements.detect{|e| e.at_line?(line)}
|
910
|
+
end
|
911
|
+
|
834
912
|
def build
|
835
913
|
elements.map{|e| e.build}
|
836
914
|
end
|
@@ -853,7 +931,7 @@ module Cucumber
|
|
853
931
|
break
|
854
932
|
end
|
855
933
|
end
|
856
|
-
r0 = SyntaxNode
|
934
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
857
935
|
r0.extend(Steps0)
|
858
936
|
|
859
937
|
node_cache[:steps][start_index] = r0
|
@@ -870,6 +948,10 @@ module Cucumber
|
|
870
948
|
elements[2]
|
871
949
|
end
|
872
950
|
|
951
|
+
def keyword_space
|
952
|
+
elements[3]
|
953
|
+
end
|
954
|
+
|
873
955
|
def name
|
874
956
|
elements[4]
|
875
957
|
end
|
@@ -884,6 +966,11 @@ module Cucumber
|
|
884
966
|
end
|
885
967
|
|
886
968
|
module Step1
|
969
|
+
def at_line?(line)
|
970
|
+
step_keyword.line == line ||
|
971
|
+
(multi.respond_to?(:at_line?) && multi.at_line?(line))
|
972
|
+
end
|
973
|
+
|
887
974
|
def build
|
888
975
|
if multi.respond_to?(:build)
|
889
976
|
Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value.strip, multi.build)
|
@@ -914,66 +1001,57 @@ module Cucumber
|
|
914
1001
|
break
|
915
1002
|
end
|
916
1003
|
end
|
917
|
-
r2 = SyntaxNode
|
1004
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
918
1005
|
s0 << r2
|
919
1006
|
if r2
|
920
1007
|
r4 = _nt_step_keyword
|
921
1008
|
s0 << r4
|
922
1009
|
if r4
|
923
|
-
|
924
|
-
loop do
|
925
|
-
r6 = _nt_space
|
926
|
-
if r6
|
927
|
-
s5 << r6
|
928
|
-
else
|
929
|
-
break
|
930
|
-
end
|
931
|
-
end
|
932
|
-
r5 = SyntaxNode.new(input, i5...index, s5)
|
1010
|
+
r5 = _nt_keyword_space
|
933
1011
|
s0 << r5
|
934
1012
|
if r5
|
935
|
-
|
936
|
-
s0 <<
|
937
|
-
if
|
938
|
-
|
939
|
-
|
1013
|
+
r6 = _nt_line_to_eol
|
1014
|
+
s0 << r6
|
1015
|
+
if r6
|
1016
|
+
i7 = index
|
1017
|
+
s8, i8 = [], index
|
940
1018
|
loop do
|
941
|
-
|
942
|
-
if
|
943
|
-
|
1019
|
+
r9 = _nt_eol
|
1020
|
+
if r9
|
1021
|
+
s8 << r9
|
944
1022
|
else
|
945
1023
|
break
|
946
1024
|
end
|
947
1025
|
end
|
948
|
-
if
|
949
|
-
self.index =
|
950
|
-
|
1026
|
+
if s8.empty?
|
1027
|
+
self.index = i8
|
1028
|
+
r8 = nil
|
951
1029
|
else
|
952
|
-
|
1030
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
953
1031
|
end
|
954
|
-
if
|
955
|
-
|
1032
|
+
if r8
|
1033
|
+
r7 = r8
|
956
1034
|
else
|
957
|
-
|
958
|
-
if
|
959
|
-
|
1035
|
+
r10 = _nt_eof
|
1036
|
+
if r10
|
1037
|
+
r7 = r10
|
960
1038
|
else
|
961
|
-
self.index =
|
962
|
-
|
1039
|
+
self.index = i7
|
1040
|
+
r7 = nil
|
963
1041
|
end
|
964
1042
|
end
|
965
|
-
s0 <<
|
966
|
-
if
|
967
|
-
|
968
|
-
if
|
969
|
-
|
1043
|
+
s0 << r7
|
1044
|
+
if r7
|
1045
|
+
r12 = _nt_multiline_arg
|
1046
|
+
if r12
|
1047
|
+
r11 = r12
|
970
1048
|
else
|
971
|
-
|
1049
|
+
r11 = instantiate_node(SyntaxNode,input, index...index)
|
972
1050
|
end
|
973
|
-
s0 <<
|
974
|
-
if
|
975
|
-
|
976
|
-
s0 <<
|
1051
|
+
s0 << r11
|
1052
|
+
if r11
|
1053
|
+
r13 = _nt_white
|
1054
|
+
s0 << r13
|
977
1055
|
end
|
978
1056
|
end
|
979
1057
|
end
|
@@ -982,7 +1060,7 @@ module Cucumber
|
|
982
1060
|
end
|
983
1061
|
end
|
984
1062
|
if s0.last
|
985
|
-
r0 = (SyntaxNode
|
1063
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
986
1064
|
r0.extend(Step0)
|
987
1065
|
r0.extend(Step1)
|
988
1066
|
else
|
@@ -996,8 +1074,16 @@ module Cucumber
|
|
996
1074
|
end
|
997
1075
|
|
998
1076
|
module ExamplesSections0
|
999
|
-
def
|
1000
|
-
elements.
|
1077
|
+
def at_line?(line)
|
1078
|
+
elements.detect { |e| e.at_line?(line) }
|
1079
|
+
end
|
1080
|
+
|
1081
|
+
def build(filter, scenario_outline)
|
1082
|
+
elements.map do |e|
|
1083
|
+
if(filter.nil? || filter.accept?(e) || filter.outline_at_line?(scenario_outline))
|
1084
|
+
e.build(filter, scenario_outline)
|
1085
|
+
end
|
1086
|
+
end.compact
|
1001
1087
|
end
|
1002
1088
|
end
|
1003
1089
|
|
@@ -1018,7 +1104,7 @@ module Cucumber
|
|
1018
1104
|
break
|
1019
1105
|
end
|
1020
1106
|
end
|
1021
|
-
r0 = SyntaxNode
|
1107
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1022
1108
|
r0.extend(ExamplesSections0)
|
1023
1109
|
|
1024
1110
|
node_cache[:examples_sections][start_index] = r0
|
@@ -1049,8 +1135,21 @@ module Cucumber
|
|
1049
1135
|
end
|
1050
1136
|
|
1051
1137
|
module Examples1
|
1052
|
-
def
|
1053
|
-
|
1138
|
+
def at_line?(line)
|
1139
|
+
examples_keyword.line == line ||
|
1140
|
+
table.at_line?(line)
|
1141
|
+
end
|
1142
|
+
|
1143
|
+
def has_tags?(tag_names)
|
1144
|
+
true
|
1145
|
+
end
|
1146
|
+
|
1147
|
+
def outline_at_line?(line)
|
1148
|
+
true
|
1149
|
+
end
|
1150
|
+
|
1151
|
+
def build(filter, scenario_outline)
|
1152
|
+
[examples_keyword.line, examples_keyword.text_value, name.text_value, table.raw(filter, scenario_outline)]
|
1054
1153
|
end
|
1055
1154
|
end
|
1056
1155
|
|
@@ -1072,7 +1171,7 @@ module Cucumber
|
|
1072
1171
|
break
|
1073
1172
|
end
|
1074
1173
|
end
|
1075
|
-
r1 = SyntaxNode
|
1174
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
1076
1175
|
s0 << r1
|
1077
1176
|
if r1
|
1078
1177
|
r3 = _nt_examples_keyword
|
@@ -1087,14 +1186,14 @@ module Cucumber
|
|
1087
1186
|
break
|
1088
1187
|
end
|
1089
1188
|
end
|
1090
|
-
r4 = SyntaxNode
|
1189
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
1091
1190
|
s0 << r4
|
1092
1191
|
if r4
|
1093
1192
|
r7 = _nt_line_to_eol
|
1094
1193
|
if r7
|
1095
1194
|
r6 = r7
|
1096
1195
|
else
|
1097
|
-
r6 = SyntaxNode
|
1196
|
+
r6 = instantiate_node(SyntaxNode,input, index...index)
|
1098
1197
|
end
|
1099
1198
|
s0 << r6
|
1100
1199
|
if r6
|
@@ -1113,7 +1212,7 @@ module Cucumber
|
|
1113
1212
|
end
|
1114
1213
|
end
|
1115
1214
|
if s0.last
|
1116
|
-
r0 = (SyntaxNode
|
1215
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1117
1216
|
r0.extend(Examples0)
|
1118
1217
|
r0.extend(Examples1)
|
1119
1218
|
else
|
@@ -1173,12 +1272,12 @@ module Cucumber
|
|
1173
1272
|
r2 = nil
|
1174
1273
|
else
|
1175
1274
|
self.index = i2
|
1176
|
-
r2 = SyntaxNode
|
1275
|
+
r2 = instantiate_node(SyntaxNode,input, index...index)
|
1177
1276
|
end
|
1178
1277
|
s1 << r2
|
1179
1278
|
if r2
|
1180
1279
|
if index < input_length
|
1181
|
-
r4 = (SyntaxNode
|
1280
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1182
1281
|
@index += 1
|
1183
1282
|
else
|
1184
1283
|
terminal_parse_failure("any character")
|
@@ -1187,7 +1286,7 @@ module Cucumber
|
|
1187
1286
|
s1 << r4
|
1188
1287
|
end
|
1189
1288
|
if s1.last
|
1190
|
-
r1 = (SyntaxNode
|
1289
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
1191
1290
|
r1.extend(LineToEol0)
|
1192
1291
|
else
|
1193
1292
|
self.index = i1
|
@@ -1199,7 +1298,7 @@ module Cucumber
|
|
1199
1298
|
break
|
1200
1299
|
end
|
1201
1300
|
end
|
1202
|
-
r0 = SyntaxNode
|
1301
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1203
1302
|
|
1204
1303
|
node_cache[:line_to_eol][start_index] = r0
|
1205
1304
|
|
@@ -1224,6 +1323,10 @@ module Cucumber
|
|
1224
1323
|
end
|
1225
1324
|
|
1226
1325
|
module PyString2
|
1326
|
+
def at_line?(line)
|
1327
|
+
line >= open_py_string.line && line <= close_py_string.line
|
1328
|
+
end
|
1329
|
+
|
1227
1330
|
def build
|
1228
1331
|
Ast::PyString.new(open_py_string.line, close_py_string.line, s.text_value, open_py_string.indentation)
|
1229
1332
|
end
|
@@ -1250,12 +1353,12 @@ module Cucumber
|
|
1250
1353
|
r4 = nil
|
1251
1354
|
else
|
1252
1355
|
self.index = i4
|
1253
|
-
r4 = SyntaxNode
|
1356
|
+
r4 = instantiate_node(SyntaxNode,input, index...index)
|
1254
1357
|
end
|
1255
1358
|
s3 << r4
|
1256
1359
|
if r4
|
1257
1360
|
if index < input_length
|
1258
|
-
r6 = (SyntaxNode
|
1361
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1259
1362
|
@index += 1
|
1260
1363
|
else
|
1261
1364
|
terminal_parse_failure("any character")
|
@@ -1264,7 +1367,7 @@ module Cucumber
|
|
1264
1367
|
s3 << r6
|
1265
1368
|
end
|
1266
1369
|
if s3.last
|
1267
|
-
r3 = (SyntaxNode
|
1370
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
1268
1371
|
r3.extend(PyString0)
|
1269
1372
|
else
|
1270
1373
|
self.index = i3
|
@@ -1276,7 +1379,7 @@ module Cucumber
|
|
1276
1379
|
break
|
1277
1380
|
end
|
1278
1381
|
end
|
1279
|
-
r2 = SyntaxNode
|
1382
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1280
1383
|
s0 << r2
|
1281
1384
|
if r2
|
1282
1385
|
r7 = _nt_close_py_string
|
@@ -1284,7 +1387,7 @@ module Cucumber
|
|
1284
1387
|
end
|
1285
1388
|
end
|
1286
1389
|
if s0.last
|
1287
|
-
r0 = (SyntaxNode
|
1390
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1288
1391
|
r0.extend(PyString1)
|
1289
1392
|
r0.extend(PyString2)
|
1290
1393
|
else
|
@@ -1330,7 +1433,7 @@ module Cucumber
|
|
1330
1433
|
s0 << r1
|
1331
1434
|
if r1
|
1332
1435
|
if input.index('"""', index) == index
|
1333
|
-
r2 = (SyntaxNode
|
1436
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
1334
1437
|
@index += 3
|
1335
1438
|
else
|
1336
1439
|
terminal_parse_failure('"""')
|
@@ -1347,7 +1450,7 @@ module Cucumber
|
|
1347
1450
|
break
|
1348
1451
|
end
|
1349
1452
|
end
|
1350
|
-
r3 = SyntaxNode
|
1453
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
1351
1454
|
s0 << r3
|
1352
1455
|
if r3
|
1353
1456
|
r5 = _nt_eol
|
@@ -1356,7 +1459,7 @@ module Cucumber
|
|
1356
1459
|
end
|
1357
1460
|
end
|
1358
1461
|
if s0.last
|
1359
|
-
r0 = (SyntaxNode
|
1462
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1360
1463
|
r0.extend(OpenPyString0)
|
1361
1464
|
r0.extend(OpenPyString1)
|
1362
1465
|
else
|
@@ -1410,11 +1513,11 @@ module Cucumber
|
|
1410
1513
|
break
|
1411
1514
|
end
|
1412
1515
|
end
|
1413
|
-
r2 = SyntaxNode
|
1516
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1414
1517
|
s0 << r2
|
1415
1518
|
if r2
|
1416
1519
|
if input.index('"""', index) == index
|
1417
|
-
r4 = (SyntaxNode
|
1520
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
1418
1521
|
@index += 3
|
1419
1522
|
else
|
1420
1523
|
terminal_parse_failure('"""')
|
@@ -1428,7 +1531,7 @@ module Cucumber
|
|
1428
1531
|
end
|
1429
1532
|
end
|
1430
1533
|
if s0.last
|
1431
|
-
r0 = (SyntaxNode
|
1534
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1432
1535
|
r0.extend(ClosePyString0)
|
1433
1536
|
r0.extend(ClosePyString1)
|
1434
1537
|
else
|
@@ -1470,7 +1573,7 @@ module Cucumber
|
|
1470
1573
|
break
|
1471
1574
|
end
|
1472
1575
|
end
|
1473
|
-
r0 = SyntaxNode
|
1576
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1474
1577
|
|
1475
1578
|
node_cache[:white][start_index] = r0
|
1476
1579
|
|