Class: Spec::Runner::Formatter::TextMateFormatter

Inherits:
HtmlFormatter show all
Defined in:
lib/spec/runner/formatter/text_mate_formatter.rb

Overview

Formats backtraces so they’re clickable by TextMate

Instance Attribute Summary

Attributes inherited from BaseTextFormatter

#example_group, #output

Instance Method Summary collapse

Methods inherited from HtmlFormatter

#dump_failure, #dump_summary, #example_failed, #example_group_number, #example_group_started, #example_number, #example_passed, #example_pending, #example_started, #extra_failure_content, #global_scripts, #global_styles, #html_header, #initialize, #move_progress, #percent_done, #report_header, #start, #start_dump

Methods included from NOOPMethodMissing

#respond_to?

Methods inherited from BaseTextFormatter

#close, #colorize_failure, #colourise, #dump_failure, #dump_pending, #dump_summary, #example_group_started, #example_pending, #format_backtrace, #initialize

Methods inherited from BaseFormatter

#add_example_group, #close, #dump_failure, #dump_pending, #dump_summary, #example_failed, #example_group_started, #example_passed, #example_pending, #example_started, #initialize, #start, #start_dump

Constructor Details

This class inherits a constructor from Spec::Runner::Formatter::HtmlFormatter

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Spec::Runner::Formatter::NOOPMethodMissing

Instance Method Details

#backtrace_line(line) ⇒ Object



8
9
10
11
12
# File 'lib/spec/runner/formatter/text_mate_formatter.rb', line 8

def backtrace_line(line)
  line.gsub(/([^:]*\.rb):(\d*)/) do
    "<a href=\"txmt://open?url=file://#{File.expand_path($1)}&line=#{$2}\">#{$1}:#{$2}</a> "
  end
end