Closed paddor closed 2 years ago
This second attempt tries to pinpoint the relevant source of the exception. Aggregated failures produce multiple lines in the output.
Fixed CI on Windows.
For more fine-grained matching in editors, I've included an error type (always E
).
Before:
./foobar_spec.rb:12:expected false got true
After:
./foobar_spec.rb:12:E:expected false got true
Without this, it's tricky to safely distinguish these file:nr:msg
lines from other lines. For example the simple errorformat='%f:%l:%m'
in Vim would also recognize any line containing a timestamp as an error. Instead, errorformat='%f:%l:%t:%m'
will only match lines like path:nr:type:msg
.
This also allows for future extension of this formatter. For example, full backtraces could be printed as informational lines (I
instead of E
) if --backtrace
was given.
@JonRowe @smortex
So after working with this for a day, I found myself running RSpec without -ff
for a few times to see more of the backtrace. Thus, I've added support for --backtrace
.
Users of this FailureListFormatter
can configure their editors to either run RSpec with -ff
or with -ff --backtrace
to get informational (backtrace) lines along with the errors lines where the code failed. It's still the same format so capable editors can jump to the exact locations.
I've simplified it more. It always includes backtrace as informational lines. I find this the most useful output, making it very quick to follow how/where an spec failed.
Please review.
Closing as stale
Second attempt of #2839.