Upgraded Rails and RSpec
[monkeycharger.git] / vendor / plugins / rspec / rspec / lib / spec / runner / formatter / text_mate_formatter.rb
blob4c0a9c7de1d389872c556e684937905a5b15c38b
1 require 'spec/runner/formatter/html_formatter'
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