Skip to content

Commit

Permalink
Fix clickable links in TextMate html output
Browse files Browse the repository at this point in the history
Right now for me running the latest RSpec, TextMate 2 alpha, Rails 4, and this bundle, when I run my specs and get html output in TextMate, the links are not clickable. I brought it up in rspec-core (rspec/rspec-core#1276 (comment)) and they pointed me here. This proposed change fixes the issue for me.
  • Loading branch information
glennfu committed Feb 1, 2014
1 parent 024bfd2 commit 46476b8
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 46476b8

Please sign in to comment.