Exception: Minitest::UnexpectedError
- Includes:
- Compress
- Defined in:
- lib/minitest.rb
Overview
Assertion wrapping an unexpected error that was raised during a run.
Constant Summary collapse
- BASE_RE =
:nodoc:
%r%#{Dir.pwd}/%
Constants inherited from Assertion
Instance Attribute Summary collapse
-
#error ⇒ Object
TODO: figure out how to use ‘cause` instead.
Instance Method Summary collapse
-
#backtrace ⇒ Object
:nodoc:.
-
#initialize(error) ⇒ UnexpectedError
constructor
:nodoc:.
-
#message ⇒ Object
:nodoc:.
-
#result_label ⇒ Object
:nodoc:.
Methods included from Compress
Methods inherited from Assertion
Constructor Details
permalink #initialize(error) ⇒ UnexpectedError
:nodoc:
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 |
# File 'lib/minitest.rb', line 1030 def initialize error # :nodoc: super "Unexpected exception" if SystemStackError === error then bt = error.backtrace new_bt = compress bt error = error.exception "#{bt.size} -> #{new_bt.size}" error.set_backtrace new_bt end self.error = error end |
Instance Attribute Details
Instance Method Details
permalink #backtrace ⇒ Object
:nodoc:
1043 1044 1045 |
# File 'lib/minitest.rb', line 1043 def backtrace # :nodoc: self.error.backtrace end |
permalink #message ⇒ Object
:nodoc:
1049 1050 1051 1052 1053 |
# File 'lib/minitest.rb', line 1049 def # :nodoc: bt = Minitest.filter_backtrace(self.backtrace).join("\n ") .gsub(BASE_RE, "") "#{self.error.class}: #{self.error.}\n #{bt}" end |
permalink #result_label ⇒ Object
:nodoc:
1055 1056 1057 |
# File 'lib/minitest.rb', line 1055 def result_label # :nodoc: "Error" end |