Skip to content

Commit 6005451

Browse files
committed
Remove repeated 'aggregate_failures' sections
1 parent 82e51eb commit 6005451

File tree

2 files changed

+0
-158
lines changed

2 files changed

+0
-158
lines changed

source/features/3-12/rspec-core/expectation-framework-integration/aggregating-failures.html.md

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -100,85 +100,6 @@ Failures:
100100
# ./spec/use_block_form_spec.rb:12
101101
```
102102

103-
## Use `aggregate_failures` block form
104-
105-
_Given_ a file named "spec/use_block_form_spec.rb" with:
106-
107-
```ruby
108-
require 'client'
109-
110-
RSpec.describe Client do
111-
after do
112-
# this should be appended to failure list
113-
expect(false).to be(true), "after hook failure"
114-
end
115-
116-
around do |ex|
117-
ex.run
118-
# this should also be appended to failure list
119-
expect(false).to be(true), "around hook failure"
120-
end
121-
122-
it "returns a successful response" do
123-
response = Client.make_request
124-
125-
aggregate_failures "testing response" do
126-
expect(response.status).to eq(200)
127-
expect(response.headers).to include("Content-Type" => "application/json")
128-
expect(response.body).to eq('{"message":"Success"}')
129-
end
130-
end
131-
end
132-
```
133-
134-
_When_ I run `rspec spec/use_block_form_spec.rb`
135-
136-
_Then_ it should fail and list all the failures:
137-
138-
```
139-
Failures:
140-
141-
1) Client returns a successful response
142-
Got 3 failures:
143-
144-
1.1) Got 3 failures from failure aggregation block "testing response".
145-
# ./spec/use_block_form_spec.rb:18
146-
# ./spec/use_block_form_spec.rb:10
147-
148-
1.1.1) Failure/Error: expect(response.status).to eq(200)
149-
150-
expected: 200
151-
got: 404
152-
153-
(compared using ==)
154-
# ./spec/use_block_form_spec.rb:19
155-
156-
1.1.2) Failure/Error: expect(response.headers).to include("Content-Type" => "application/json")
157-
expected {"Content-Type" => "text/plain"} to include {"Content-Type" => "application/json"}
158-
Diff:
159-
@@ -1,2 +1,2 @@
160-
-"Content-Type" => "application/json",
161-
+"Content-Type" => "text/plain",
162-
# ./spec/use_block_form_spec.rb:20
163-
164-
1.1.3) Failure/Error: expect(response.body).to eq('{"message":"Success"}')
165-
166-
expected: "{\"message\":\"Success\"}"
167-
got: "Not Found"
168-
169-
(compared using ==)
170-
# ./spec/use_block_form_spec.rb:21
171-
172-
1.2) Failure/Error: expect(false).to be(true), "after hook failure"
173-
after hook failure
174-
# ./spec/use_block_form_spec.rb:6
175-
# ./spec/use_block_form_spec.rb:10
176-
177-
1.3) Failure/Error: expect(false).to be(true), "around hook failure"
178-
around hook failure
179-
# ./spec/use_block_form_spec.rb:12
180-
```
181-
182103
## Use `:aggregate_failures` metadata
183104

184105
_Given_ a file named "spec/use_metadata_spec.rb" with:

source/features/3-13/rspec-core/expectation-framework-integration/aggregating-failures.html.md

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -100,85 +100,6 @@ Failures:
100100
# ./spec/use_block_form_spec.rb:12
101101
```
102102

103-
## Use `aggregate_failures` block form
104-
105-
_Given_ a file named "spec/use_block_form_spec.rb" with:
106-
107-
```ruby
108-
require 'client'
109-
110-
RSpec.describe Client do
111-
after do
112-
# this should be appended to failure list
113-
expect(false).to be(true), "after hook failure"
114-
end
115-
116-
around do |ex|
117-
ex.run
118-
# this should also be appended to failure list
119-
expect(false).to be(true), "around hook failure"
120-
end
121-
122-
it "returns a successful response" do
123-
response = Client.make_request
124-
125-
aggregate_failures "testing response" do
126-
expect(response.status).to eq(200)
127-
expect(response.headers).to include("Content-Type" => "application/json")
128-
expect(response.body).to eq('{"message":"Success"}')
129-
end
130-
end
131-
end
132-
```
133-
134-
_When_ I run `rspec spec/use_block_form_spec.rb`
135-
136-
_Then_ it should fail and list all the failures:
137-
138-
```
139-
Failures:
140-
141-
1) Client returns a successful response
142-
Got 3 failures:
143-
144-
1.1) Got 3 failures from failure aggregation block "testing response".
145-
# ./spec/use_block_form_spec.rb:18
146-
# ./spec/use_block_form_spec.rb:10
147-
148-
1.1.1) Failure/Error: expect(response.status).to eq(200)
149-
150-
expected: 200
151-
got: 404
152-
153-
(compared using ==)
154-
# ./spec/use_block_form_spec.rb:19
155-
156-
1.1.2) Failure/Error: expect(response.headers).to include("Content-Type" => "application/json")
157-
expected {"Content-Type" => "text/plain"} to include {"Content-Type" => "application/json"}
158-
Diff:
159-
@@ -1,2 +1,2 @@
160-
-"Content-Type" => "application/json",
161-
+"Content-Type" => "text/plain",
162-
# ./spec/use_block_form_spec.rb:20
163-
164-
1.1.3) Failure/Error: expect(response.body).to eq('{"message":"Success"}')
165-
166-
expected: "{\"message\":\"Success\"}"
167-
got: "Not Found"
168-
169-
(compared using ==)
170-
# ./spec/use_block_form_spec.rb:21
171-
172-
1.2) Failure/Error: expect(false).to be(true), "after hook failure"
173-
after hook failure
174-
# ./spec/use_block_form_spec.rb:6
175-
# ./spec/use_block_form_spec.rb:10
176-
177-
1.3) Failure/Error: expect(false).to be(true), "around hook failure"
178-
around hook failure
179-
# ./spec/use_block_form_spec.rb:12
180-
```
181-
182103
## Use `:aggregate_failures` metadata
183104

184105
_Given_ a file named "spec/use_metadata_spec.rb" with:

0 commit comments

Comments
 (0)