Exception: Minitest::UnexpectedError

Inherits:
Assertion show all
Defined in:
lib/minitest.rb

Overview

Assertion wrapping an unexpected error that was raised during a run.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Assertion

#location, #result_code

Constructor Details

#initialize(exception) ⇒ UnexpectedError

:nodoc:



549
550
551
552
# File 'lib/minitest.rb', line 549

def initialize exception # :nodoc:
  super
  self.exception = exception
end

Instance Attribute Details

#exceptionObject

:nodoc:



547
548
549
# File 'lib/minitest.rb', line 547

def exception
  @exception
end

Instance Method Details

#backtraceObject

:nodoc:



554
555
556
# File 'lib/minitest.rb', line 554

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

#errorObject

:nodoc:



558
559
560
# File 'lib/minitest.rb', line 558

def error # :nodoc:
  self.exception
end

#messageObject

:nodoc:



562
563
564
565
# File 'lib/minitest.rb', line 562

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

#result_labelObject

:nodoc:



567
568
569
# File 'lib/minitest.rb', line 567

def result_label # :nodoc:
  "Error"
end