123456789_123456789_123456789_123456789_123456789_

Exception: Minitest::UnexpectedError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Assertion, Exception
Instance Chain:
self, Assertion, Exception
Inherits: Minitest::Assertion
Defined in: lib/minitest.rb

Overview

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

Class Method Summary

Instance Attribute Summary

  • #error rw Internal use only

    TODO: figure out how to use cause instead.

Instance Method Summary

Assertion - Inherited

#location

Where was this run before an assertion was raised?

#error, #result_code, #result_label

Constructor Details

.new(error) ⇒ UnexpectedError

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 945

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

Instance Attribute Details

#error (rw)

This method is for internal use only.

TODO: figure out how to use cause instead

[ GitHub ]

  
# File 'lib/minitest.rb', line 943

attr_accessor :error # :nodoc:

Instance Method Details

#backtrace

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 950

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

#message

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 954

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

#result_label

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 959

def result_label # :nodoc:
  "Error"
end