cucumber 2.0.0.beta.3 → 2.0.0.beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +20 -3
  3. data/cucumber.gemspec +2 -1
  4. data/examples/tcl/features/step_definitions/fib_steps.rb +1 -1
  5. data/features/docs/extending_cucumber/custom_formatter.feature +65 -7
  6. data/features/docs/formatters/debug_formatter.feature +24 -17
  7. data/features/docs/formatters/pretty_formatter.feature +42 -0
  8. data/features/docs/formatters/rerun_formatter.feature +3 -2
  9. data/lib/cucumber/cli/configuration.rb +3 -7
  10. data/lib/cucumber/cli/main.rb +1 -1
  11. data/lib/cucumber/{runtime → filters}/gated_receiver.rb +5 -1
  12. data/lib/cucumber/filters/quit.rb +24 -0
  13. data/lib/cucumber/filters/randomizer.rb +36 -0
  14. data/lib/cucumber/filters/tag_limits.rb +40 -0
  15. data/lib/cucumber/{runtime → filters}/tag_limits/test_case_index.rb +4 -2
  16. data/lib/cucumber/{runtime → filters}/tag_limits/verifier.rb +4 -2
  17. data/lib/cucumber/formatter/console.rb +2 -2
  18. data/lib/cucumber/formatter/debug.rb +1 -8
  19. data/lib/cucumber/formatter/fanout.rb +27 -0
  20. data/lib/cucumber/formatter/gherkin_formatter_adapter.rb +1 -3
  21. data/lib/cucumber/formatter/html.rb +12 -4
  22. data/lib/cucumber/formatter/ignore_missing_messages.rb +20 -0
  23. data/lib/cucumber/formatter/junit.rb +2 -2
  24. data/lib/cucumber/formatter/legacy_api/adapter.rb +1008 -0
  25. data/lib/cucumber/formatter/legacy_api/ast.rb +374 -0
  26. data/lib/cucumber/formatter/legacy_api/results.rb +51 -0
  27. data/lib/cucumber/formatter/legacy_api/runtime_facade.rb +30 -0
  28. data/lib/cucumber/formatter/pretty.rb +4 -0
  29. data/lib/cucumber/formatter/rerun.rb +14 -88
  30. data/lib/cucumber/language_support/language_methods.rb +0 -54
  31. data/lib/cucumber/multiline_argument/data_table.rb +3 -4
  32. data/lib/cucumber/platform.rb +1 -1
  33. data/lib/cucumber/runtime.rb +41 -107
  34. data/spec/cucumber/{runtime → filters}/gated_receiver_spec.rb +3 -3
  35. data/spec/cucumber/{runtime → filters}/tag_limits/test_case_index_spec.rb +3 -3
  36. data/spec/cucumber/{runtime → filters}/tag_limits/verifier_spec.rb +4 -4
  37. data/spec/cucumber/{runtime/tag_limits/filter_spec.rb → filters/tag_limits_spec.rb} +6 -6
  38. data/spec/cucumber/formatter/debug_spec.rb +39 -530
  39. data/spec/cucumber/formatter/html_spec.rb +56 -0
  40. data/spec/cucumber/formatter/legacy_api/adapter_spec.rb +1902 -0
  41. data/spec/cucumber/formatter/pretty_spec.rb +128 -0
  42. data/spec/cucumber/formatter/rerun_spec.rb +106 -0
  43. data/spec/cucumber/formatter/spec_helper.rb +6 -2
  44. data/spec/cucumber/rb_support/rb_language_spec.rb +2 -2
  45. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +1 -1
  46. data/spec/cucumber/runtime_spec.rb +1 -5
  47. data/spec/spec_helper.rb +2 -0
  48. metadata +44 -29
  49. data/features/docs/extending_cucumber/formatter_callbacks.feature +0 -370
  50. data/features/docs/output_from_hooks.feature +0 -128
  51. data/lib/cucumber/reports/legacy_formatter.rb +0 -1349
  52. data/lib/cucumber/runtime/results.rb +0 -64
  53. data/lib/cucumber/runtime/tag_limits.rb +0 -15
  54. data/lib/cucumber/runtime/tag_limits/filter.rb +0 -31
  55. data/spec/cucumber/reports/legacy_formatter_spec.rb +0 -1860
  56. data/spec/cucumber/runtime/results_spec.rb +0 -88
@@ -1,7 +1,7 @@
1
- require "cucumber/runtime/gated_receiver"
1
+ require "cucumber/filters/gated_receiver"
2
2
 
3
- describe Cucumber::Runtime::GatedReceiver do
4
- subject(:gated_receiver) { Cucumber::Runtime::GatedReceiver.new(receiver) }
3
+ describe Cucumber::Filters::GatedReceiver do
4
+ subject(:gated_receiver) { Cucumber::Filters::GatedReceiver.new(receiver) }
5
5
 
6
6
  let(:receiver) { double(:receiver) }
7
7
  let(:test_cases){ [double(:test_case), double(:test_case)] }
@@ -1,7 +1,7 @@
1
- require "cucumber/runtime/tag_limits"
1
+ require "cucumber/filters/tag_limits"
2
2
 
3
- describe Cucumber::Runtime::TagLimits::TestCaseIndex do
4
- subject(:index) { Cucumber::Runtime::TagLimits::TestCaseIndex.new }
3
+ describe Cucumber::Filters::TagLimits::TestCaseIndex do
4
+ subject(:index) { Cucumber::Filters::TagLimits::TestCaseIndex.new }
5
5
 
6
6
  let(:test_cases) do
7
7
  [
@@ -1,8 +1,8 @@
1
- require "cucumber/runtime/tag_limits"
1
+ require "cucumber/filters/tag_limits"
2
2
 
3
- describe Cucumber::Runtime::TagLimits::Verifier do
3
+ describe Cucumber::Filters::TagLimits::Verifier do
4
4
  describe "#verify!" do
5
- subject(:verifier) { Cucumber::Runtime::TagLimits::Verifier.new(tag_limits) }
5
+ subject(:verifier) { Cucumber::Filters::TagLimits::Verifier.new(tag_limits) }
6
6
  let(:test_case_index) { double(:test_case_index) }
7
7
 
8
8
  context "the tag counts exceed the tag limits" do
@@ -28,7 +28,7 @@ describe Cucumber::Runtime::TagLimits::Verifier do
28
28
  expect {
29
29
  verifier.verify!(test_case_index)
30
30
  }.to raise_error(
31
- Cucumber::Runtime::TagLimits::TagLimitExceededError,
31
+ Cucumber::Filters::TagLimitExceededError,
32
32
  "@exceed_me occurred 2 times, but the limit was set to 1\n" +
33
33
  " path/to/some.feature:3\n" +
34
34
  " path/to/some/other.feature:8"
@@ -1,7 +1,7 @@
1
- require "cucumber/runtime/tag_limits"
1
+ require "cucumber/filters/tag_limits"
2
2
 
3
- describe Cucumber::Runtime::TagLimits::Filter do
4
- subject(:filter) { Cucumber::Runtime::TagLimits::Filter.new(tag_limits, receiver) }
3
+ describe Cucumber::Filters::TagLimits do
4
+ subject(:filter) { Cucumber::Filters::TagLimits.new(tag_limits, receiver) }
5
5
 
6
6
  let(:tag_limits) { double(:tag_limits) }
7
7
  let(:receiver) { double(:receiver) }
@@ -11,8 +11,8 @@ describe Cucumber::Runtime::TagLimits::Filter do
11
11
  let(:test_case) { double(:test_case) }
12
12
 
13
13
  before do
14
- allow(Cucumber::Runtime::GatedReceiver).to receive(:new).with(receiver) { gated_receiver }
15
- allow(Cucumber::Runtime::TagLimits::TestCaseIndex).to receive(:new) { test_case_index }
14
+ allow(Cucumber::Filters::GatedReceiver).to receive(:new).with(receiver) { gated_receiver }
15
+ allow(Cucumber::Filters::TagLimits::TestCaseIndex).to receive(:new) { test_case_index }
16
16
  end
17
17
 
18
18
  describe "#test_case" do
@@ -36,7 +36,7 @@ describe Cucumber::Runtime::TagLimits::Filter do
36
36
  let(:verifier) { double(:verifier) }
37
37
 
38
38
  before do
39
- allow(Cucumber::Runtime::TagLimits::Verifier).to receive(:new).with(tag_limits) { verifier }
39
+ allow(Cucumber::Filters::TagLimits::Verifier).to receive(:new).with(tag_limits) { verifier }
40
40
  allow(gated_receiver).to receive(:done)
41
41
  end
42
42
 
@@ -28,542 +28,51 @@ module Cucumber
28
28
 
29
29
  it "outputs the events as expected" do
30
30
  expect(@out.string).to eq(<<EXPECTED)
31
+ before_test_case
31
32
  before_features
32
- before_feature
33
- before_tags
34
- after_tags
35
- feature_name
36
- before_feature_element
37
- before_tags
38
- after_tags
39
- scenario_name
40
- before_steps
41
- before_step
42
- before_step_result
43
- step_name
44
- after_step_result
45
- after_step
46
- after_steps
47
- after_feature_element
48
- after_feature
49
- after_features
50
- EXPECTED
51
- end
52
- end
53
-
54
- describe "with a scenario with multiple steps" do
55
- define_feature <<-FEATURE
56
- Feature: Banana party
57
-
58
- Scenario:
59
- Given there are bananas
60
- And there are berries
61
- FEATURE
62
-
63
- it "outputs the events as expected" do
64
- expect(@out.string).to eq(<<EXPECTED)
65
- before_features
66
- before_feature
67
- before_tags
68
- after_tags
69
- feature_name
70
- before_feature_element
71
- before_tags
72
- after_tags
73
- scenario_name
74
- before_steps
75
- before_step
76
- before_step_result
77
- step_name
78
- after_step_result
79
- after_step
80
- before_step
81
- before_step_result
82
- step_name
83
- after_step_result
84
- after_step
85
- after_steps
86
- after_feature_element
87
- after_feature
88
- after_features
89
- EXPECTED
90
- end
91
- end
92
-
93
- describe "with 2 scenarios" do
94
- define_feature <<-FEATURE
95
- Feature: Banana party
96
-
97
- Scenario: Monkey eats banana
98
- Given there are bananas
99
-
100
- Scenario: Monkey is hungry
101
- Given there are no bananas
102
- FEATURE
103
-
104
- it "outputs the events as expected" do
105
- expect(@out.string).to eq(<<EXPECTED)
106
- before_features
107
- before_feature
108
- before_tags
109
- after_tags
110
- feature_name
111
- before_feature_element
112
- before_tags
113
- after_tags
114
- scenario_name
115
- before_steps
116
- before_step
117
- before_step_result
118
- step_name
119
- after_step_result
120
- after_step
121
- after_steps
122
- after_feature_element
123
- before_feature_element
124
- before_tags
125
- after_tags
126
- scenario_name
127
- before_steps
128
- before_step
129
- before_step_result
130
- step_name
131
- after_step_result
132
- after_step
133
- after_steps
134
- after_feature_element
135
- after_feature
136
- after_features
137
- EXPECTED
138
- end
139
- end
140
-
141
- describe "with a background" do
142
- define_feature <<-FEATURE
143
- Feature:
144
-
145
- Background:
146
- Given there is a tree
147
-
148
- Scenario:
149
- Given there are bananas
150
- FEATURE
151
-
152
- it "outputs the events as expected" do
153
- pending("legacy cucumber fires extra step events") if ENV['USE_LEGACY']
154
- expect(@out.string).to eq(<<EXPECTED)
155
- before_features
156
- before_feature
157
- before_tags
158
- after_tags
159
- feature_name
160
- before_background
161
- background_name
162
- before_steps
163
- before_step
164
- before_step_result
165
- step_name
166
- after_step_result
167
- after_step
168
- after_steps
169
- after_background
170
- before_feature_element
171
- before_tags
172
- after_tags
173
- scenario_name
174
- before_steps
175
- before_step
176
- before_step_result
177
- step_name
178
- after_step_result
179
- after_step
180
- after_steps
181
- after_feature_element
182
- after_feature
183
- after_features
184
- EXPECTED
185
- end
186
- end
187
-
188
- describe "with a scenario outline" do
189
- define_feature <<-FEATURE
190
- Feature: Fud Pyramid
191
-
192
- Scenario Outline: Monkey eats a balanced diet
193
- Given there are <Things>
194
-
195
- Examples: Fruit
196
- | Things |
197
- | apples |
198
- | bananas |
199
- Examples: Vegetables
200
- | Things |
201
- | broccoli |
202
- | carrots |
203
- FEATURE
204
-
205
- it "outputs the events as expected" do
206
- expect(@out.string).to eq(<<EXPECTED)
207
- before_features
208
- before_feature
209
- before_tags
210
- after_tags
211
- feature_name
212
- before_feature_element
213
- before_tags
214
- after_tags
215
- scenario_name
216
- before_steps
217
- before_step
218
- before_step_result
219
- step_name
220
- after_step_result
221
- after_step
222
- after_steps
223
- before_examples_array
224
- before_examples
225
- examples_name
226
- before_outline_table
227
- before_table_row
228
- before_table_cell
229
- table_cell_value
230
- after_table_cell
231
- after_table_row
232
- before_table_row
233
- before_table_cell
234
- table_cell_value
235
- after_table_cell
236
- after_table_row
237
- before_table_row
238
- before_table_cell
239
- table_cell_value
240
- after_table_cell
241
- after_table_row
242
- after_outline_table
243
- after_examples
244
- before_examples
245
- examples_name
246
- before_outline_table
247
- before_table_row
248
- before_table_cell
249
- table_cell_value
250
- after_table_cell
251
- after_table_row
252
- before_table_row
253
- before_table_cell
254
- table_cell_value
255
- after_table_cell
256
- after_table_row
257
- before_table_row
258
- before_table_cell
259
- table_cell_value
260
- after_table_cell
261
- after_table_row
262
- after_outline_table
263
- after_examples
264
- after_examples_array
265
- after_feature_element
266
- after_feature
267
- after_features
268
- EXPECTED
269
- end
270
- end
271
-
272
- describe "with a scenario outline with a pystring" do
273
- define_feature <<-FEATURE
274
- Feature:
275
- Scenario Outline: Monkey eats a balanced diet
276
- Given a multiline string:
277
- """
278
- Monkeys eat <things>
279
- """
280
-
281
- Examples:
282
- | things |
283
- | apples |
284
- FEATURE
285
-
286
- it "outputs the events as expected" do
287
- expect(@out.string).to eq(<<EXPECTED)
288
- before_features
289
- before_feature
290
- before_tags
291
- after_tags
292
- feature_name
293
- before_feature_element
294
- before_tags
295
- after_tags
296
- scenario_name
297
- before_steps
298
- before_step
299
- before_step_result
300
- step_name
301
- before_multiline_arg
302
- doc_string
303
- after_multiline_arg
304
- after_step_result
305
- after_step
306
- after_steps
307
- before_examples_array
308
- before_examples
309
- examples_name
310
- before_outline_table
311
- before_table_row
312
- before_table_cell
313
- table_cell_value
314
- after_table_cell
315
- after_table_row
316
- before_table_row
317
- before_table_cell
318
- table_cell_value
319
- after_table_cell
320
- after_table_row
321
- after_outline_table
322
- after_examples
323
- after_examples_array
324
- after_feature_element
325
- after_feature
326
- after_features
327
- EXPECTED
328
- end
329
- end
330
-
331
- describe "with a step with a py string" do
332
- define_feature <<-FEATURE
333
- Feature: Traveling circus
334
-
335
- Scenario: Monkey goes to town
336
- Given there is a monkey called:
337
- """
338
- foo
339
- """
340
- FEATURE
341
-
342
- it "displays the events as expected" do
343
- expect(@out.string).to eq(<<EXPECTED)
344
- before_features
345
- before_feature
346
- before_tags
347
- after_tags
348
- feature_name
349
- before_feature_element
350
- before_tags
351
- after_tags
352
- scenario_name
353
- before_steps
354
- before_step
355
- before_step_result
356
- step_name
357
- before_multiline_arg
358
- doc_string
359
- after_multiline_arg
360
- after_step_result
361
- after_step
362
- after_steps
363
- after_feature_element
364
- after_feature
365
- after_features
366
- EXPECTED
367
- end
368
- end
369
-
370
- describe "with a multiline step arg" do
371
- define_feature <<-FEATURE
372
- Feature: Traveling circus
373
-
374
- Scenario: Monkey goes to town
375
- Given there are monkeys:
376
- | name |
377
- | foo |
378
- | bar |
379
- FEATURE
380
-
381
- it "displays the events as expected" do
382
- expect(@out.string).to eq(<<EXPECTED)
383
- before_features
384
- before_feature
385
- before_tags
386
- after_tags
387
- feature_name
388
- before_feature_element
389
- before_tags
390
- after_tags
391
- scenario_name
392
- before_steps
393
- before_step
394
- before_step_result
395
- step_name
396
- before_multiline_arg
397
- before_table_row
398
- before_table_cell
399
- table_cell_value
400
- after_table_cell
401
- after_table_row
402
- before_table_row
403
- before_table_cell
404
- table_cell_value
405
- after_table_cell
406
- after_table_row
407
- before_table_row
408
- before_table_cell
409
- table_cell_value
410
- after_table_cell
411
- after_table_row
412
- after_multiline_arg
413
- after_step_result
414
- after_step
415
- after_steps
416
- after_feature_element
417
- after_feature
418
- after_features
419
- EXPECTED
420
- end
421
- end
422
-
423
- describe "with a table in the background and the scenario" do
424
- define_feature <<-FEATURE
425
- Feature: accountant monkey
426
-
427
- Background:
428
- Given table:
429
- | a | b |
430
- | c | d |
431
- Scenario:
432
- Given another table:
433
- | e | f |
434
- | g | h |
435
- FEATURE
436
-
437
- it "displays the table for the background" do
438
- pending("legacy cucumber fires extra step events") if ENV['USE_LEGACY']
439
- expect(@out.string).to eq(<<EXPECTED)
440
- before_features
441
- before_feature
442
- before_tags
443
- after_tags
444
- feature_name
445
- before_background
446
- background_name
447
- before_steps
448
- before_step
449
- before_step_result
450
- step_name
451
- before_multiline_arg
452
- before_table_row
453
- before_table_cell
454
- table_cell_value
455
- after_table_cell
456
- before_table_cell
457
- table_cell_value
458
- after_table_cell
459
- after_table_row
460
- before_table_row
461
- before_table_cell
462
- table_cell_value
463
- after_table_cell
464
- before_table_cell
465
- table_cell_value
466
- after_table_cell
467
- after_table_row
468
- after_multiline_arg
469
- after_step_result
470
- after_step
471
- after_steps
472
- after_background
473
- before_feature_element
474
- before_tags
475
- after_tags
476
- scenario_name
477
- before_steps
478
- before_step
479
- before_step_result
480
- step_name
481
- before_multiline_arg
482
- before_table_row
483
- before_table_cell
484
- table_cell_value
485
- after_table_cell
486
- before_table_cell
487
- table_cell_value
488
- after_table_cell
489
- after_table_row
490
- before_table_row
491
- before_table_cell
492
- table_cell_value
493
- after_table_cell
494
- before_table_cell
495
- table_cell_value
496
- after_table_cell
497
- after_table_row
498
- after_multiline_arg
499
- after_step_result
500
- after_step
501
- after_steps
502
- after_feature_element
503
- after_feature
504
- after_features
505
- EXPECTED
506
- end
507
- end
508
-
509
- describe "with a py string in the background and the scenario" do
510
- define_feature <<-FEATURE
511
- Feature: py strings
512
-
513
- Background:
514
- Given stuff:
515
- """
516
- foo
517
- """
518
- Scenario:
519
- Given more stuff:
520
- """
521
- bar
522
- """
523
- FEATURE
524
-
525
- it "displays the background py string" do
526
- pending("legacy cucumber fires extra step events") if ENV['USE_LEGACY']
527
- expect(@out.string).to eq(<<EXPECTED)
528
- before_features
529
- before_feature
530
- before_tags
531
- after_tags
532
- feature_name
533
- before_background
534
- background_name
535
- before_steps
536
- before_step
537
- before_step_result
538
- step_name
539
- before_multiline_arg
540
- doc_string
541
- after_multiline_arg
542
- after_step_result
543
- after_step
544
- after_steps
545
- after_background
546
- before_feature_element
547
- before_tags
548
- after_tags
549
- scenario_name
550
- before_steps
551
- before_step
552
- before_step_result
553
- step_name
554
- before_multiline_arg
555
- doc_string
556
- after_multiline_arg
557
- after_step_result
558
- after_step
559
- after_steps
560
- after_feature_element
561
- after_feature
33
+ before_feature
34
+ before_tags
35
+ after_tags
36
+ feature_name
37
+ before_test_step
38
+ after_test_step
39
+ before_test_step
40
+ after_test_step
41
+ before_test_step
42
+ after_test_step
43
+ before_test_step
44
+ after_test_step
45
+ before_test_step
46
+ after_test_step
47
+ before_test_step
48
+ before_feature_element
49
+ before_tags
50
+ after_tags
51
+ scenario_name
52
+ before_steps
53
+ before_step
54
+ before_step_result
55
+ step_name
56
+ after_step_result
57
+ after_step
58
+ after_test_step
59
+ before_test_step
60
+ after_test_step
61
+ before_test_step
62
+ after_test_step
63
+ before_test_step
64
+ after_test_step
65
+ after_steps
66
+ after_feature_element
67
+ after_test_case
68
+ after_feature
562
69
  after_features
70
+ done
563
71
  EXPECTED
564
72
  end
565
73
  end
566
74
  end
567
75
  end
76
+
568
77
  end
569
78
  end