@@ -18,31 +18,6 @@ module Formatter
18
18
run_defined_feature
19
19
end
20
20
21
- describe 'with a scenario with no steps' do
22
- define_feature <<-FEATURE
23
- Feature: Banana party
24
-
25
- Scenario: Monkey eats bananas
26
- FEATURE
27
-
28
- it 'outputs the json data' do
29
- expect ( load_normalised_json ( @out ) ) . to eq MultiJson . load ( %{
30
- [{"id": "banana-party",
31
- "uri": "spec.feature",
32
- "keyword": "Feature",
33
- "name": "Banana party",
34
- "line": 1,
35
- "description": "",
36
- "elements":
37
- [{"id": "banana-party;monkey-eats-bananas",
38
- "keyword": "Scenario",
39
- "name": "Monkey eats bananas",
40
- "line": 3,
41
- "description": "",
42
- "type": "scenario"}]}]} )
43
- end
44
- end
45
-
46
21
describe 'with a scenario with an undefined step' do
47
22
define_feature <<-FEATURE
48
23
Feature: Banana party
@@ -106,7 +81,7 @@ module Formatter
106
81
[{"keyword": "Given ",
107
82
"name": "there are bananas",
108
83
"line": 4,
109
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:87 "},
84
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:62 "},
110
85
"result": {"status": "passed",
111
86
"duration": 1}}]}]}]} )
112
87
end
@@ -143,9 +118,9 @@ module Formatter
143
118
[{"keyword": "Given ",
144
119
"name": "there are bananas",
145
120
"line": 4,
146
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:124 "},
121
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:99 "},
147
122
"result": {"status": "failed",
148
- "error_message": "no bananas (RuntimeError)\\ n./spec/cucumber/formatter/json_spec.rb:124 :in `/^there are bananas$/'\\ nspec.feature:4:in `Given there are bananas'",
123
+ "error_message": "no bananas (RuntimeError)\\ n./spec/cucumber/formatter/json_spec.rb:99 :in `/^there are bananas$/'\\ nspec.feature:4:in `Given there are bananas'",
149
124
"duration": 1}}]}]}]} )
150
125
end
151
126
end
@@ -181,9 +156,9 @@ module Formatter
181
156
[{"keyword": "Given ",
182
157
"name": "there are bananas",
183
158
"line": 4,
184
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:162 "},
159
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:137 "},
185
160
"result": {"status": "pending",
186
- "error_message": "TODO (Cucumber::Pending)\\ n./spec/cucumber/formatter/json_spec.rb:162 :in `/^there are bananas$/'\\ nspec.feature:4:in `Given there are bananas'",
161
+ "error_message": "TODO (Cucumber::Pending)\\ n./spec/cucumber/formatter/json_spec.rb:137 :in `/^there are bananas$/'\\ nspec.feature:4:in `Given there are bananas'",
187
162
"duration": 1}}]}]}]} )
188
163
end
189
164
end
@@ -223,7 +198,7 @@ module Formatter
223
198
[{"keyword": "Given ",
224
199
"name": "there are bananas",
225
200
"line": 8,
226
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:204 "},
201
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:179 "},
227
202
"result": {"status": "passed",
228
203
"duration": 1}}]}]}]} )
229
204
end
@@ -277,7 +252,7 @@ module Formatter
277
252
[{"keyword": "Given ",
278
253
"name": "there are bananas",
279
254
"line": 6,
280
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:252 "},
255
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:227 "},
281
256
"result": {"status": "passed",
282
257
"duration": 1}}]},
283
258
{"id": "banana-party;monkey-eats-bananas;fruit-table;2",
@@ -296,7 +271,7 @@ module Formatter
296
271
[{"keyword": "Given ",
297
272
"name": "there are bananas",
298
273
"line": 15,
299
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:252 "},
274
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:227 "},
300
275
"result": {"status": "passed",
301
276
"duration": 1}}]}]}]} )
302
277
end
@@ -355,7 +330,7 @@ module Formatter
355
330
[{"keyword": "Given ",
356
331
"name": "there are bananas",
357
332
"line": 6,
358
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:332 "},
333
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:307 "},
359
334
"result": {"status": "passed",
360
335
"duration": 1}}]},
361
336
{"id": "banana-party;monkey-eats-bananas",
@@ -372,7 +347,7 @@ module Formatter
372
347
"line": 11,
373
348
"comments": [{"value": "#step comment1",
374
349
"line": 10}],
375
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:333 "},
350
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:308 "},
376
351
"result": {"status": "passed",
377
352
"duration": 1}}]},
378
353
{"keyword": "Background",
@@ -386,7 +361,7 @@ module Formatter
386
361
[{"keyword": "Given ",
387
362
"name": "there are bananas",
388
363
"line": 6,
389
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:332 "},
364
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:307 "},
390
365
"result": {"status": "passed",
391
366
"duration": 1}}]},
392
367
{"id": "banana-party;monkey-eats-bananas;fruit-table;2",
@@ -407,7 +382,7 @@ module Formatter
407
382
"line": 22,
408
383
"comments": [{"value": "#step comment2",
409
384
"line": 15}],
410
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:333 "},
385
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:308 "},
411
386
"result": {"status": "passed",
412
387
"duration": 1}}]}]}]} )
413
388
end
@@ -450,7 +425,7 @@ module Formatter
450
425
"doc_string": {"value": "the doc string",
451
426
"content_type": "",
452
427
"line": 5},
453
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:428 "},
428
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:403 "},
454
429
"result": {"status": "passed",
455
430
"duration": 1}}]}]}]} )
456
431
end
@@ -488,7 +463,7 @@ module Formatter
488
463
"name": "there are bananas",
489
464
"line": 4,
490
465
"output": ["from step"],
491
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:468 "},
466
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:443 "},
492
467
"result": {"status": "passed",
493
468
"duration": 1}}]}]}]} )
494
469
end
@@ -600,7 +575,7 @@ module Formatter
600
575
"line": 4,
601
576
"embeddings": [{"mime_type": "mime-type",
602
577
"data": "YWJj"}],
603
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:578 "},
578
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:553 "},
604
579
"result": {"status": "passed",
605
580
"duration": 1}}]}]}]} )
606
581
end
@@ -645,7 +620,7 @@ module Formatter
645
620
"line": 4,
646
621
"embeddings": [{"mime_type": "image/png",
647
622
"data": "Zm9v"}],
648
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:618 "},
623
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:593 "},
649
624
"result": {"status": "passed",
650
625
"duration": 1}}]}]}]} )
651
626
end
@@ -686,31 +661,31 @@ module Formatter
686
661
"description": "",
687
662
"type": "scenario",
688
663
"before":
689
- [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:663 "},
664
+ [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:638 "},
690
665
"result": {"status": "passed",
691
666
"duration": 1}},
692
- {"match": {"location": "spec/cucumber/formatter/json_spec.rb:664 "},
667
+ {"match": {"location": "spec/cucumber/formatter/json_spec.rb:639 "},
693
668
"result": {"status": "passed",
694
669
"duration": 1}}],
695
670
"steps":
696
671
[{"keyword": "Given ",
697
672
"name": "there are bananas",
698
673
"line": 4,
699
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:670 "},
674
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:645 "},
700
675
"result": {"status": "passed",
701
676
"duration": 1},
702
677
"after":
703
- [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:667 "},
678
+ [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:642 "},
704
679
"result": {"status": "passed",
705
680
"duration": 1}},
706
- {"match": {"location": "spec/cucumber/formatter/json_spec.rb:668 "},
681
+ {"match": {"location": "spec/cucumber/formatter/json_spec.rb:643 "},
707
682
"result": {"status": "passed",
708
683
"duration": 1}}]}],
709
684
"after":
710
- [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:666 "},
685
+ [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:641 "},
711
686
"result": {"status": "passed",
712
687
"duration": 1}},
713
- {"match": {"location": "spec/cucumber/formatter/json_spec.rb:665 "},
688
+ {"match": {"location": "spec/cucumber/formatter/json_spec.rb:640 "},
714
689
"result": {"status": "passed",
715
690
"duration": 1}}]}]}]} )
716
691
end
@@ -748,13 +723,13 @@ module Formatter
748
723
[{"keyword": "Given ",
749
724
"name": "there are bananas",
750
725
"line": 4,
751
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:729 "},
726
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:704 "},
752
727
"result": {"status": "passed",
753
728
"duration": 1}}],
754
729
"around":
755
730
[{"match": {"location": "unknown_hook_location:1"},
756
731
"result": {"status": "failed",
757
- "error_message": "error (RuntimeError)\\ n./spec/cucumber/formatter/json_spec.rb:728 :in `Around'",
732
+ "error_message": "error (RuntimeError)\\ n./spec/cucumber/formatter/json_spec.rb:703 :in `Around'",
758
733
"duration": 1}}]}]}]} )
759
734
end
760
735
end
@@ -795,7 +770,7 @@ module Formatter
795
770
"rows":
796
771
[{"cells": ["aa", "bb"]},
797
772
{"cells": ["cc", "dd"]}],
798
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:773 "},
773
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:748 "},
799
774
"result": {"status": "passed",
800
775
"duration": 1}}]}]}]} )
801
776
end
0 commit comments