Upgraded Rails and RSpec
[monkeycharger.git] / vendor / plugins / rspec / examples / custom_formatter.rb
blob851c9906f92aab1cdf4c86c7427d13c3a0d3e0e8
1 require 'spec/runner/formatter/progress_bar_formatter'
3 # Example of a formatter with custom bactrace printing. Run me with:
4 # ruby bin/spec failing_examples -r examples/custom_formatter.rb -f CustomFormatter
5 class CustomFormatter < Spec::Runner::Formatter::ProgressBarFormatter
6   def backtrace_line(line)
7     line.gsub(/([^:]*\.rb):(\d*)/) do
8       "<a href=\"file://#{File.expand_path($1)}\">#{$1}:#{$2}</a> "
9     end
10   end
11 end