Skip to content

Commit cad8a7e

Browse files
committed
Address David’s feedback.
1 parent c658179 commit cad8a7e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

source/blog/2015-06-12-rspec-3-3-has-been-released.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,18 @@ If you want to enable this feature everywhere, you can use [`define_derived_meta
291291
~~~ ruby
292292
RSpec.configure do |c|
293293
c.define_derived_metadata do |meta|
294-
meta[:aggregate_failures] = true
294+
meta[:aggregate_failures] = true unless meta.key?(:aggregate_failures)
295295
end
296296
end
297297
~~~
298298

299-
Of course, you may not want this enabled everywhere. When you've got _dependent_ expectations
300-
(e.g. where an expectation only makes sense if the prior expectation passed), or if you're
301-
using expectations to express a pre-condition, you'll probably want the example to immediately abort
299+
300+
Of course, you may not want this enabled by default everywhere. The
301+
`unless meta.key?(:aggregate_failures)` bit allows you to opt out individual
302+
examples or groups by tagging them with `aggregate_failures: false`. When
303+
you've got _dependent_ expectations (e.g. where an expectation only makes
304+
sense if the prior expectation passed), or if you're using expectations to
305+
express a pre-condition, you'll probably want the example to immediately abort
302306
when the expectation fails.
303307

304308
### Expectations: Improved Failure Output
@@ -335,7 +339,7 @@ Failure/Error: expect([Time.now]).to include(Time.now)
335339
+[2015-06-09 07:49:16.610635000 -0700]
336340
~~~
337341

338-
...which makes it much clearer that the time objects differ at the level of milliseconds.
342+
...which makes it much clearer that the time objects differ at the subsecond level.
339343

340344
Thanks to Gavin Miller, Nicholas Chmielewski and Siva Gollapalli for contributing to
341345
these improvements!

0 commit comments

Comments
 (0)