Skip to content

Handle multiple failures in aggregate_failures block #56

Open
@TimAle

Description

@TimAle

RSpec 3.3 allows to group multiple failures using aggregrate_failures, but formatter doesn't not handle it. It just puts

<testcase classname="spec.sample_test" name="test with aggregate_failures with multiple failures" file="./spec/sample_test.rb" time="0.037076"><failure message="RSpec::Expectations::MultipleExpectationsNotMetError" type="RSpec::Expectations::MultipleExpectationsNotMetError">
./spec/sample_test.rb:4:in `block (2 levels) in &lt;top (required)&gt;&apos;</failure></testcase>

when RSpec output is

Failures:

  1) test with aggregate_failures with multiple failures
     Got 3 failures from failure aggregation block "multiple failures".
     # ./spec/sample_test.rb:4:in `block (2 levels) in <top (required)>'

     1.1) Failure/Error: expect(0).to eq 1

            expected: 1
                 got: 0

            (compared using ==)
          # ./spec/sample_test.rb:5:in `block (3 levels) in <top (required)>'

     1.2) Failure/Error: expect(2).to eq 3

            expected: 3
                 got: 2

            (compared using ==)
          # ./spec/sample_test.rb:6:in `block (3 levels) in <top (required)>'

     1.3) Failure/Error: expect(4).to eq 5

            expected: 5
                 got: 4

            (compared using ==)
          # ./spec/sample_test.rb:7:in `block (3 levels) in <top (required)>'

Is there a way to handle it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions