Skip to content

Commit

Permalink
Merge pull request #65 from glennfu/patch-1
Browse files Browse the repository at this point in the history
Fix clickable links in TextMate html output
  • Loading branch information
pcasaretto committed Feb 2, 2014
2 parents 024bfd2 + 46476b8 commit 6423447
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Support/lib/rspec/mate/text_mate_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,44 @@ def extra_failure_content(exception)
@snippet_extractor ||= RSpec::Core::Formatters::SnippetExtractor.new
" <pre class=\"ruby\"><code>#{@snippet_extractor.snippet(backtrace)}</code></pre>"
end

def example_failed(example)
# super(example)

unless @header_red
@header_red = true
@printer.make_header_red
end

unless @example_group_red
@example_group_red = true
@printer.make_example_group_header_red(example_group_number)
end

@printer.move_progress(percent_done)

exception = example.metadata[:execution_result][:exception]
exception_details = if exception
{
:message => exception.message,
:backtrace => format_backtrace(exception.backtrace, example).join("\n")
}
else
false
end
extra = extra_failure_content(exception)

@printer.print_example_failed(
example.execution_result[:pending_fixed],
example.description,
example.execution_result[:run_time],
@failed_examples.size,
exception_details,
(extra == "") ? false : extra,
false
)
@printer.flush
end
end
end
end
Expand Down

0 comments on commit 6423447

Please sign in to comment.