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

Instance Method Summary

Assertion - Inherited

#location

Where was this run before an assertion was raised?

#error, #result_code, #result_label

Constructor Details

.new(exception) ⇒ UnexpectedError

This method is for internal use only.
[ GitHub ]

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

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

Instance Attribute Details

#exception (rw)

This method is for internal use only.
[ GitHub ]

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

attr_accessor :exception # :nodoc:

Instance Method Details

#backtrace

This method is for internal use only.
[ GitHub ]

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

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

#error

This method is for internal use only.
[ GitHub ]

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

def error # :nodoc:
  self.exception
end

#message

This method is for internal use only.
[ GitHub ]

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

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

#result_label

This method is for internal use only.
[ GitHub ]

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

def result_label # :nodoc:
  "Error"
end