|
1 | 1 | Feature: Aggregating Failures
|
2 | 2 |
|
3 |
| - RSpec::Expectations provides [`aggregate_failures`](../../../rspec-expectations/docs/aggregating-failures), an API that allows you to group a set of expectations and see all the failures at once, rather than it aborting on the first failure. RSpec::Core improves on this feature in a couple of ways: |
| 3 | + RSpec::Expectations provides [`aggregate_failures`](/rspec/rspec-expectations/v/3-4/docs/aggregating-failures), an API that allows you to group a set of expectations and see all the failures at once, rather than it aborting on the first failure. RSpec::Core improves on this feature in a couple of ways: |
4 | 4 |
|
5 | 5 | * RSpec::Core provides much better failure output, adding code snippets and backtraces to the sub-failures, just like it does for any normal failure.
|
6 | 6 | * RSpec::Core provides [metadata](../metadata/user-defined-metadata) integration for this feature. Each example that is tagged with `:aggregate_failures` will be wrapped in an `aggregate_failures` block. You can also use `config.define_derived_metadata` to apply this to every example automatically.
|
@@ -56,41 +56,41 @@ Feature: Aggregating Failures
|
56 | 56 | Got 3 failures:
|
57 | 57 |
|
58 | 58 | 1.1) Got 3 failures from failure aggregation block "testing response".
|
59 |
| - # ./spec/use_block_form_spec.rb:18:in `block (2 levels) in <top (required)>' |
60 |
| - # ./spec/use_block_form_spec.rb:10:in `block (2 levels) in <top (required)>' |
| 59 | + # ./spec/use_block_form_spec.rb:18 |
| 60 | + # ./spec/use_block_form_spec.rb:10 |
61 | 61 |
|
62 | 62 | 1.1.1) Failure/Error: expect(response.status).to eq(200)
|
63 | 63 |
|
64 | 64 | expected: 200
|
65 | 65 | got: 404
|
66 | 66 |
|
67 | 67 | (compared using ==)
|
68 |
| - # ./spec/use_block_form_spec.rb:19:in `block (3 levels) in <top (required)>' |
| 68 | + # ./spec/use_block_form_spec.rb:19 |
69 | 69 |
|
70 | 70 | 1.1.2) Failure/Error: expect(response.headers).to include("Content-Type" => "application/json")
|
71 | 71 | expected {"Content-Type" => "text/plain"} to include {"Content-Type" => "application/json"}
|
72 | 72 | Diff:
|
73 | 73 | @@ -1,2 +1,2 @@
|
74 | 74 | -[{"Content-Type"=>"application/json"}]
|
75 | 75 | +"Content-Type" => "text/plain",
|
76 |
| - # ./spec/use_block_form_spec.rb:20:in `block (3 levels) in <top (required)>' |
| 76 | + # ./spec/use_block_form_spec.rb:20 |
77 | 77 |
|
78 | 78 | 1.1.3) Failure/Error: expect(response.body).to eq('{"message":"Success"}')
|
79 | 79 |
|
80 | 80 | expected: "{\"message\":\"Success\"}"
|
81 | 81 | got: "Not Found"
|
82 | 82 |
|
83 | 83 | (compared using ==)
|
84 |
| - # ./spec/use_block_form_spec.rb:21:in `block (3 levels) in <top (required)>' |
| 84 | + # ./spec/use_block_form_spec.rb:21 |
85 | 85 |
|
86 | 86 | 1.2) Failure/Error: expect(false).to be(true), "after hook failure"
|
87 | 87 | after hook failure
|
88 |
| - # ./spec/use_block_form_spec.rb:6:in `block (2 levels) in <top (required)>' |
89 |
| - # ./spec/use_block_form_spec.rb:10:in `block (2 levels) in <top (required)>' |
| 88 | + # ./spec/use_block_form_spec.rb:6 |
| 89 | + # ./spec/use_block_form_spec.rb:10 |
90 | 90 |
|
91 | 91 | 1.3) Failure/Error: expect(false).to be(true), "around hook failure"
|
92 | 92 | around hook failure
|
93 |
| - # ./spec/use_block_form_spec.rb:12:in `block (2 levels) in <top (required)>' |
| 93 | + # ./spec/use_block_form_spec.rb:12 |
94 | 94 | """
|
95 | 95 |
|
96 | 96 | Scenario: Use `:aggregate_failures` metadata
|
@@ -126,21 +126,21 @@ Feature: Aggregating Failures
|
126 | 126 | got: 404
|
127 | 127 |
|
128 | 128 | (compared using ==)
|
129 |
| - # ./spec/use_metadata_spec.rb:7:in `block (2 levels) in <top (required)>' |
| 129 | + # ./spec/use_metadata_spec.rb:7 |
130 | 130 |
|
131 | 131 | 1.2) Failure/Error: expect(response.body).to eq('{"message":"Redirect"}')
|
132 | 132 |
|
133 | 133 | expected: "{\"message\":\"Redirect\"}"
|
134 | 134 | got: "Not Found"
|
135 | 135 |
|
136 | 136 | (compared using ==)
|
137 |
| - # ./spec/use_metadata_spec.rb:8:in `block (2 levels) in <top (required)>' |
| 137 | + # ./spec/use_metadata_spec.rb:8 |
138 | 138 |
|
139 | 139 | 1.3) Failure/Error: redirect_response = Client.make_request(response.headers.fetch('Location'))
|
140 | 140 | KeyError:
|
141 | 141 | key not found: "Location"
|
142 |
| - # ./spec/use_metadata_spec.rb:10:in `fetch' |
143 |
| - # ./spec/use_metadata_spec.rb:10:in `block (2 levels) in <top (required)>' |
| 142 | + # ./spec/use_metadata_spec.rb:10 |
| 143 | + # ./spec/use_metadata_spec.rb:10 |
144 | 144 | """
|
145 | 145 |
|
146 | 146 | Scenario: Enable failure aggregation globally using `define_derived_metadata`
|
@@ -332,21 +332,21 @@ Feature: Aggregating Failures
|
332 | 332 | got: 404
|
333 | 333 |
|
334 | 334 | (compared using ==)
|
335 |
| - # ./spec/pending_spec.rb:8:in `block (2 levels) in <top (required)>' |
| 335 | + # ./spec/pending_spec.rb:8 |
336 | 336 |
|
337 | 337 | 1.2) Failure/Error: expect(response.headers).to include("Content-Type" => "application/json")
|
338 | 338 | expected {"Content-Type" => "text/plain"} to include {"Content-Type" => "application/json"}
|
339 | 339 | Diff:
|
340 | 340 | @@ -1,2 +1,2 @@
|
341 | 341 | -[{"Content-Type"=>"application/json"}]
|
342 | 342 | +"Content-Type" => "text/plain",
|
343 |
| - # ./spec/pending_spec.rb:9:in `block (2 levels) in <top (required)>' |
| 343 | + # ./spec/pending_spec.rb:9 |
344 | 344 |
|
345 | 345 | 1.3) Failure/Error: expect(response.body).to eq('{"message":"Success"}')
|
346 | 346 |
|
347 | 347 | expected: "{\"message\":\"Success\"}"
|
348 | 348 | got: "Not Found"
|
349 | 349 |
|
350 | 350 | (compared using ==)
|
351 |
| - # ./spec/pending_spec.rb:10:in `block (2 levels) in <top (required)>' |
| 351 | + # ./spec/pending_spec.rb:10 |
352 | 352 | """
|
0 commit comments