Class: Assert::Result::Error

Inherits:
Base
  • Object
show all
Defined in:
lib/assert/result.rb,
lib/assert/result.rb

Class Method Summary collapse

Methods inherited from Base

#==, #backtrace, #data, #initialize, #inspect, #message, #name, #set_backtrace, #test_name, #to_s, #to_sym, #trace, #type

Constructor Details

This class inherits a constructor from Assert::Result::Base

Class Method Details

.for_test(test, exception) ⇒ Object

error results are generated by raising exceptions in tests



155
156
157
158
159
160
161
# File 'lib/assert/result.rb', line 155

def self.for_test(test, exception)
  if exception.kind_of?(Exception)
    super(test, "#{exception.message} (#{exception.class.name})", exception.backtrace)
  else
    raise ArgumentError, "generate error results by raising an exception"
  end
end

.nameObject



152
# File 'lib/assert/result.rb', line 152

def self.name; 'Error'; end

.typeObject



151
# File 'lib/assert/result.rb', line 151

def self.type; :error;  end