Permalink
Browse files

Restore a public API I unintentionally broke in 39857f3.

@DouweM rightly pointed out that I broke this API.

39857f3#commitcomment-2236278
  • Loading branch information...
1 parent c765c3b commit f06254c00770387e3a8a2efbdbc973035c217f6a @myronmarston myronmarston committed Dec 1, 2012
@@ -117,6 +117,14 @@ def close
restore_sync_output
end
+ # @api public
+ #
+ # Formats the given backtrace based on configuration and
+ # the metadata of the given example.
+ def format_backtrace(backtrace, example)
+ super(backtrace, example.metadata)
+ end
+
protected
def configuration
@@ -160,7 +160,7 @@ def format_caller(caller_info)
end
def dump_backtrace(example)
- format_backtrace(example.execution_result[:exception].backtrace, example.metadata).each do |backtrace_info|
+ format_backtrace(example.execution_result[:exception].backtrace, example).each do |backtrace_info|
output.puts cyan("#{long_padding}# #{backtrace_info}")
end
end
@@ -86,7 +86,7 @@ def example_failed(example)
exception_details = if exception
{
:message => exception.message,
- :backtrace => format_backtrace(exception.backtrace, example.metadata).join("\n")
+ :backtrace => format_backtrace(exception.backtrace, example).join("\n")
}
else
false
@@ -101,7 +101,7 @@
end
it "removes lines from rspec and lines that come before the invocation of the at_exit autorun hook" do
- formatter.format_backtrace(backtrace).should eq(["./my_spec.rb:5"])
+ formatter.format_backtrace(backtrace, stub.as_null_object).should eq(["./my_spec.rb:5"])
end
end

0 comments on commit f06254c

Please sign in to comment.