Skip to content

Commit 6423447

Browse files
committed
Merge pull request #65 from glennfu/patch-1
Fix clickable links in TextMate html output
2 parents 024bfd2 + 46476b8 commit 6423447

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

Support/lib/rspec/mate/text_mate_formatter.rb

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)