]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/rspec-1.1.2/lib/spec/runner/formatter/text_mate_formatter.rb
added RSpec and RSpec on Rails
[rails.git] / vendor / gems / rspec-1.1.2 / lib / spec / runner / formatter / text_mate_formatter.rb
1 require 'spec/runner/formatter/html_formatter'
2
3 module Spec
4   module Runner
5     module Formatter
6       # Formats backtraces so they're clickable by TextMate
7       class TextMateFormatter < HtmlFormatter
8         def backtrace_line(line)
9           line.gsub(/([^:]*\.rb):(\d*)/) do
10             "<a href=\"txmt://open?url=file://#{File.expand_path($1)}&line=#{$2}\">#{$1}:#{$2}</a> "
11           end
12         end
13       end
14     end
15   end
16 end