Method: RSpec::Matchers#aggregate_failures
- Defined in:
- lib/rspec/matchers.rb
#aggregate_failures(label = nil, metadata = {}) { ... } ⇒ Object
Note:
The implementation of this feature uses a thread-local variable, which means that if you have an expectation failure in another thread, it'll abort like normal.
Allows multiple expectations in the provided block to fail, and then aggregates them into a single exception, rather than aborting on the first expectation failure like normal. This allows you to see all failures from an entire set of expectations without splitting each off into its own example (which may slow things down if the example setup is expensive).
305 306 307 |
# File 'lib/rspec/matchers.rb', line 305 def aggregate_failures(label=nil, ={}, &block) Expectations::FailureAggregator.new(label, ).aggregate(&block) end |