Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple failures in aggregate_failures block #56

Open
TimAle opened this issue Dec 27, 2017 · 2 comments · May be fixed by #58 or #74
Open

Handle multiple failures in aggregate_failures block #56

TimAle opened this issue Dec 27, 2017 · 2 comments · May be fixed by #58 or #74

Comments

@TimAle
Copy link

TimAle commented Dec 27, 2017

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?

@TimAle TimAle linked a pull request Mar 2, 2018 that will close this issue
@xuantuan58
Copy link

We got exactly the same issue, what's the Issue/PR status?

@jasoncodes
Copy link

This had been a minor annoyance for us for a while and as it happens I finally got around to looking into and implementing a fix yesterday. See PR #74 for my patch. I ended up leveraging the same fully_formatted_lines method as in PR #58.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants