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:


910
911
912
913
# File 'lib/minitest.rb', line 910

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

Instance Attribute Details

#exceptionObject

:nodoc:


908
909
910
# File 'lib/minitest.rb', line 908

def exception
  @exception
end

Instance Method Details

#backtraceObject

:nodoc:


915
916
917
# File 'lib/minitest.rb', line 915

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

#errorObject

:nodoc:


919
920
921
# File 'lib/minitest.rb', line 919

def error # :nodoc:
  self.exception
end

#messageObject

:nodoc:


923
924
925
926
# File 'lib/minitest.rb', line 923

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

#result_labelObject

:nodoc:


928
929
930
# File 'lib/minitest.rb', line 928

def result_label # :nodoc:
  "Error"
end