@@ -12,7 +12,7 @@ def initialize(exception, example, options={})
12
12
@exception = exception
13
13
@example = example
14
14
@message_color = options . fetch ( :message_color ) { RSpec . configuration . failure_color }
15
- @description = options . fetch ( :description_formatter ) { Proc . new { example . full_description } } . call ( self )
15
+ @description = options . fetch ( :description ) { example . full_description }
16
16
@detail_formatter = options . fetch ( :detail_formatter ) { Proc . new { } }
17
17
@extra_detail_formatter = options . fetch ( :extra_detail_formatter ) { Proc . new { } }
18
18
@backtrace_formatter = options . fetch ( :backtrace_formatter ) { RSpec . configuration . backtrace_formatter }
@@ -87,10 +87,6 @@ def fully_formatted_lines(failure_number, colorizer)
87
87
lines
88
88
end
89
89
90
- def failure_slash_error_line
91
- @failure_slash_error_line ||= "Failure/Error: #{ read_failed_line . strip } "
92
- end
93
-
94
90
private
95
91
96
92
def final_exception ( exception )
@@ -142,15 +138,20 @@ def exception_class_name(exception=@exception)
142
138
end
143
139
144
140
def failure_lines
145
- @failure_lines ||= begin
146
- lines = [ ]
147
- lines << failure_slash_error_line unless ( description == failure_slash_error_line )
148
- lines << "#{ exception_class_name } :" unless exception_class_name =~ /RSpec/
149
- encoded_string ( exception . message . to_s ) . split ( "\n " ) . each do |line |
150
- lines << " #{ line } "
151
- end
152
- lines
141
+ @failure_lines ||= [ failure_slash_error_line ] + exception_lines
142
+ end
143
+
144
+ def failure_slash_error_line
145
+ "Failure/Error: #{ read_failed_line . strip } "
146
+ end
147
+
148
+ def exception_lines
149
+ lines = [ ]
150
+ lines << "#{ exception_class_name } :" unless exception_class_name =~ /RSpec/
151
+ encoded_string ( exception . message . to_s ) . split ( "\n " ) . each do |line |
152
+ lines << " #{ line } "
153
153
end
154
+ lines
154
155
end
155
156
156
157
def add_shared_group_lines ( lines , colorizer )
@@ -230,9 +231,9 @@ def options
230
231
def pending_options
231
232
if @execution_result . pending_fixed?
232
233
{
233
- :description_formatter => Proc . new { "#{ @example . full_description } FIXED" } ,
234
- :message_color => RSpec . configuration . fixed_color ,
235
- :failure_lines => [
234
+ :description => "#{ @example . full_description } FIXED" ,
235
+ :message_color => RSpec . configuration . fixed_color ,
236
+ :failure_lines => [
236
237
"Expected pending '#{ @execution_result . pending_message } ' to fail. No Error was raised."
237
238
]
238
239
}
@@ -255,8 +256,6 @@ def with_multiple_error_options_as_needed(exception, options)
255
256
options [ :message_color ] )
256
257
)
257
258
258
- options [ :description_formatter ] &&= Proc . new { }
259
-
260
259
return options unless exception . aggregation_metadata [ :hide_backtrace ]
261
260
options [ :backtrace_formatter ] = EmptyBacktraceFormatter
262
261
options
@@ -294,7 +293,7 @@ def sub_failure_list_formatter(exception, message_color)
294
293
FlatMap . flat_map ( exception . all_exceptions . each_with_index ) do |failure , index |
295
294
options = with_multiple_error_options_as_needed (
296
295
failure ,
297
- :description_formatter => :failure_slash_error_line . to_proc ,
296
+ :description => nil ,
298
297
:indentation => 0 ,
299
298
:message_color => message_color || RSpec . configuration . failure_color ,
300
299
:skip_shared_group_trace => true
0 commit comments