File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
lib/rspec_junit_formatter Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -77,13 +77,23 @@ def failure_message_for(example)
7777 end
7878
7979 def failure_for ( notification )
80- lines = notification . fully_formatted_lines ( nil , RSpec ::Core ::Notifications ::NullColorizer ) . map ( &:to_s )
80+ lines = if notification . respond_to? ( :fully_formatted_lines )
81+ notification . fully_formatted_lines ( nil , RSpec ::Core ::Notifications ::NullColorizer ) . map ( &:to_s )
82+ else
83+ notification . fully_formatted ( nil , RSpec ::Core ::Notifications ::NullColorizer ) . split ( "\n " )
84+ end
8185
8286 unless lines . first . empty?
8387 raise 'Expected first line to be empty'
8488 end
8589 lines . shift
8690
91+ unless notification . respond_to? ( :fully_formatted_lines )
92+ if lines [ 0 ] [ 2 ] == ')'
93+ lines [ 0 ] [ 2 ] = ' '
94+ end
95+ end
96+
8797 indentation = lines . reject ( &:empty? ) . map { |line | line [ /^[ \t ]*/ ] } . min
8898 lines = lines . map { |line | line . sub ( /^#{ Regexp . escape indentation } / , '' ) }
8999
You can’t perform that action at this time.
0 commit comments