From bee25599ee6d31e2174952b885db6b818f431156 Mon Sep 17 00:00:00 2001 From: TimAle Date: Fri, 2 Mar 2018 18:08:31 +0300 Subject: [PATCH] Fix failure description for multiple failure --- lib/rspec_junit_formatter/rspec3.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/rspec_junit_formatter/rspec3.rb b/lib/rspec_junit_formatter/rspec3.rb index 6a51d13..f2e213c 100644 --- a/lib/rspec_junit_formatter/rspec3.rb +++ b/lib/rspec_junit_formatter/rspec3.rb @@ -77,7 +77,12 @@ def failure_message_for(example) end def failure_for(notification) - strip_diff_colors(notification.message_lines.join("\n")) << "\n" << notification.formatted_backtrace.join("\n") + strip_diff_colors(formatted_lines_for(notification).join("\n")) + end + + def formatted_lines_for(notification) + # drop(2) removes the description (regardless of newlines) and leading blank line + notification.fully_formatted_lines(nil, RSpec::Core::Notifications::NullColorizer).drop(2) end def exception_for(notification)