File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,44 @@ def extra_failure_content(exception)
2828 @snippet_extractor ||= RSpec ::Core ::Formatters ::SnippetExtractor . new
2929 " <pre class=\" ruby\" ><code>#{ @snippet_extractor . snippet ( backtrace ) } </code></pre>"
3030 end
31+
32+ def example_failed ( example )
33+ # super(example)
34+
35+ unless @header_red
36+ @header_red = true
37+ @printer . make_header_red
38+ end
39+
40+ unless @example_group_red
41+ @example_group_red = true
42+ @printer . make_example_group_header_red ( example_group_number )
43+ end
44+
45+ @printer . move_progress ( percent_done )
46+
47+ exception = example . metadata [ :execution_result ] [ :exception ]
48+ exception_details = if exception
49+ {
50+ :message => exception . message ,
51+ :backtrace => format_backtrace ( exception . backtrace , example ) . join ( "\n " )
52+ }
53+ else
54+ false
55+ end
56+ extra = extra_failure_content ( exception )
57+
58+ @printer . print_example_failed (
59+ example . execution_result [ :pending_fixed ] ,
60+ example . description ,
61+ example . execution_result [ :run_time ] ,
62+ @failed_examples . size ,
63+ exception_details ,
64+ ( extra == "" ) ? false : extra ,
65+ false
66+ )
67+ @printer . flush
68+ end
3169 end
3270 end
3371 end
You can’t perform that action at this time.
0 commit comments