Exception: Minitest::UnexpectedError

Inherits:
Assertion show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/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

Methods inherited from Exception

#as_json

Constructor Details

#initialize(error) ⇒ UnexpectedError

:nodoc:



937
938
939
940
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/lib/minitest.rb', line 937

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

Instance Attribute Details

#errorObject

TODO: figure out how to use ‘cause` instead



935
936
937
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/lib/minitest.rb', line 935

def error
  @error
end

Instance Method Details

#backtraceObject

:nodoc:



942
943
944
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/lib/minitest.rb', line 942

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

#messageObject

:nodoc:



946
947
948
949
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/lib/minitest.rb', line 946

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

#result_labelObject

:nodoc:



951
952
953
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/lib/minitest.rb', line 951

def result_label # :nodoc:
  "Error"
end