changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/examples/pure/custom_formatter.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1require File.dirname(__FILE__) + '/spec_helper'
2require 'spec/runner/formatter/progress_bar_formatter'
3
4# Example of a formatter with custom bactrace printing. Run me with:
5# ruby bin/spec failing_examples -r examples/custom_formatter.rb -f CustomFormatter
6class CustomFormatter < Spec::Runner::Formatter::ProgressBarFormatter
7 def backtrace_line(line)
8 line.gsub(/([^:]*\.rb):(\d*)/) do
9 "<a href=\"file://#{File.expand_path($1)}\">#{$1}:#{$2}</a> "
10 end
11 end
12end