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:



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

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

Instance Attribute Details

#exceptionObject

:nodoc:



733
734
735
# File 'lib/minitest.rb', line 733

def exception
  @exception
end

Instance Method Details

#backtraceObject

:nodoc:



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

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

#errorObject

:nodoc:



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

def error # :nodoc:
  self.exception
end

#messageObject

:nodoc:



748
749
750
751
# File 'lib/minitest.rb', line 748

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

#result_labelObject

:nodoc:



753
754
755
# File 'lib/minitest.rb', line 753

def result_label # :nodoc:
  "Error"
end