Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

trim current working directory from backtrace lines

  • Loading branch information...
commit 0f99955bece0631ad0a66286e9437484bcf50985 1 parent 09f9433
@dchelimsky dchelimsky authored
View
3  lib/rspec/core/formatters/base_formatter.rb
@@ -99,6 +99,7 @@ def format_backtrace(backtrace, example)
def backtrace_line(line)
return nil if configuration.cleaned_from_backtrace?(line)
+ line.sub!(File.expand_path("."), ".")
line.sub!(/\A([^:]+:\d+)$/, '\\1')
return nil if line == '-e:1'
line
@@ -123,4 +124,4 @@ def read_failed_line(exception, example)
end
end
-end
+end
View
2  rspec-core.gemspec
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Chad Humphries", "David Chelimsky"]
- s.date = %q{2010-03-31}
+ s.date = %q{2010-04-02}
s.description = %q{Rspec runner and example group classes}
s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
s.executables = ["rspec", "spec"]
View
8 spec/rspec/core/formatters/base_formatter_spec.rb
@@ -37,9 +37,13 @@
end
describe '#format_backtrace' do
-
it "displays the full backtrace when the example is given the :full_backtrace => true option", :full_backtrace => true
-
+ end
+
+ describe "backtrace_line" do
+ it "trims current working directory" do
+ formatter.__send__(:backtrace_line, File.expand_path(__FILE__)).should == "./spec/rspec/core/formatters/base_formatter_spec.rb"
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.