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:



726
727
728
729
# File 'lib/minitest.rb', line 726

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

Instance Attribute Details

#exceptionObject

:nodoc:



724
725
726
# File 'lib/minitest.rb', line 724

def exception
  @exception
end

Instance Method Details

#backtraceObject

:nodoc:



731
732
733
# File 'lib/minitest.rb', line 731

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

#errorObject

:nodoc:



735
736
737
# File 'lib/minitest.rb', line 735

def error # :nodoc:
  self.exception
end

#messageObject

:nodoc:



739
740
741
742
# File 'lib/minitest.rb', line 739

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

#result_labelObject

:nodoc:



744
745
746
# File 'lib/minitest.rb', line 744

def result_label # :nodoc:
  "Error"
end