class Minitest::UnexpectedError

def backtrace # :nodoc:

:nodoc:
def backtrace # :nodoc:
  self.error.backtrace
end

def initialize error # :nodoc:

:nodoc:
def initialize error # :nodoc:
  super "Unexpected exception"
  if SystemStackError === error then
    bt = error.backtrace
    new_bt = compress bt
    error = error.exception "#{bt.size} -> #{new_bt.size}"
    error.set_backtrace new_bt
  end
  self.error = error
end

def message # :nodoc:

:nodoc:
def message # :nodoc:
  bt = Minitest.filter_backtrace(self.backtrace).join("\n    ")
    .gsub(BASE_RE, "")
  "#{self.error.class}: #{self.error.message}\n    #{bt}"
end

def result_label # :nodoc:

:nodoc:
def result_label # :nodoc:
  "Error"
end