Exception: Minitest::UnexpectedError

Inherits:
Assertion show all
Defined in:
opal/stdlib/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:



681
682
683
684
# File 'opal/stdlib/minitest.rb', line 681

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

Instance Attribute Details

#exceptionObject

:nodoc:



679
680
681
# File 'opal/stdlib/minitest.rb', line 679

def exception
  @exception
end

Instance Method Details

#backtraceObject

:nodoc:



686
687
688
# File 'opal/stdlib/minitest.rb', line 686

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

#errorObject

:nodoc:



690
691
692
# File 'opal/stdlib/minitest.rb', line 690

def error # :nodoc:
  self.exception
end

#messageObject

:nodoc:



694
695
696
697
# File 'opal/stdlib/minitest.rb', line 694

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

#result_labelObject

:nodoc:



699
700
701
# File 'opal/stdlib/minitest.rb', line 699

def result_label # :nodoc:
  "Error"
end