All,<br><br>I've found that the html view for the rspec formatter falls to pieces with Rails 2.02 and rspec 1.10. Has anyone else run into this trouble?<br><br>Here's a monkey patch that fixes the problem. A more elegant fix would be in order, but this gets the job done:
<br><br>Index: /Users/timcharper/www/exchange/vendor/plugins/rspec/lib/spec/runner/formatter/text_mate_formatter.rb<br>===================================================================<br>--- /Users/timcharper/www/exchange/vendor/plugins/rspec/lib/spec/runner/formatter/text_mate_formatter.rb (revision 906)
<br>+++ /Users/timcharper/www/exchange/vendor/plugins/rspec/lib/spec/runner/formatter/text_mate_formatter.rb (working copy)<br>@@ -6,8 +6,9 @@<br> # Formats backtraces so they're clickable by TextMate<br> class TextMateFormatter < HtmlFormatter
<br> def backtrace_line(line)<br>- line.gsub(/([^:]*\.rb):(\d*)/) do<br>- "<a href=\"txmt://open?url=file://#{File.expand_path($1)}&line=#{$2}\">#{$1}:#{$2}</a> "
<br>+ line.gsub!(/^(On line #([0-9]+) of )(.+)$/) { "app/views/#{$3}:#{$2}"}<br>+ line.gsub(/([^:]*\.(rb|rhtml|erb)):(\d*)/) do<br>+ "<a href=\"txmt://open?url=file://#{
File.expand_path($1)}&line=#{$3}\">#{$1}:#{$3}</a> "<br> end<br> end<br> end<br>Index: /Users/timcharper/www/exchange/vendor/plugins/rspec/lib/spec/runner/formatter/base_text_formatter.rb
<br>===================================================================<br>--- /Users/timcharper/www/exchange/vendor/plugins/rspec/lib/spec/runner/formatter/base_text_formatter.rb (revision 906)<br>+++ /Users/timcharper/www/exchange/vendor/plugins/rspec/lib/spec/runner/formatter/base_text_formatter.rb (working copy)
<br>@@ -88,6 +88,7 @@<br> <br> def format_backtrace(backtrace)<br> return "" if backtrace.nil?<br>+ backtrace = backtrace.first.split("\n").map { |l| h(l).strip }<br>
backtrace.map { |line| backtrace_line(line) }.join("\n")<br> end<br> <br><br><br>Tim<br>