Skip to content
Browse files

truncate the backtrace line paths so they start from the project root

  • Loading branch information...
1 parent cf6145e commit bc22dd5373160b69e71cae2fe40ab0a7de866404 @dchelimsky dchelimsky committed
Showing with 2 additions and 6 deletions.
  1. +1 −4 lib/rspec/core/formatters/base_formatter.rb
  2. +1 −2 spec/autotest/failed_results_re_spec.rb
View
5 lib/rspec/core/formatters/base_formatter.rb
@@ -98,10 +98,7 @@ def close
def format_backtrace(backtrace, example)
return "" unless backtrace
return backtrace if example.metadata[:full_backtrace] == true
-
- cleansed = backtrace.select { |line| backtrace_line(line) }
- # Kick the describe stack info off the list, just keep the line the problem happened on from that file
- # cleansed = [cleansed.detect { |line| line.split(':').first == example.metadata[:caller].split(':').first }] if cleansed.size > 1
+ cleansed = backtrace.map { |line| backtrace_line(line) }.compact
cleansed.empty? ? backtrace : cleansed
end
View
3 spec/autotest/failed_results_re_spec.rb
@@ -16,7 +16,6 @@
re = Autotest::Rspec2.new.failed_results_re
re =~ example_output
$1.should == "group name example name\n Failure/Error: example = group.example(\"example name\") { \"this\".should eq(\"that\") }"
- $2.should == __FILE__
+ $2.should == __FILE__.sub(File.expand_path('.'),'.')
end
-
end

0 comments on commit bc22dd5

Please sign in to comment.
Something went wrong with that request. Please try again.