Permalink
Browse files

check for refactored RSpec backtrace formatters and use the new metho…

…d signature
  • Loading branch information...
1 parent f159b53 commit 3ec35b81c0d32bb76b48d426b79de2c7ea526362 Gregg Van Hove & Helge Holzmann committed Nov 13, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/ci/reporter/rspec.rb
@@ -75,8 +75,14 @@ def location
output = []
output.push "#{exception.class.name << ":"}" unless exception.class.name =~ /RSpec/
output.push @exception.message
+
+ format_metadata = if defined?(::RSpec::Core::BacktraceFormatter)
+ @example.metadata
+ else
+ @example
+ end
- [@formatter.format_backtrace(@exception.backtrace, @example)].flatten.each do |backtrace_info|
+ [@formatter.format_backtrace(@exception.backtrace, format_metadata)].flatten.each do |backtrace_info|
backtrace_info.lines.each do |line|
output.push " #{line}"
end

0 comments on commit 3ec35b8

Please sign in to comment.