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, #file_line, #file_name, #initialize, #inspect, #line_num, #message, #name, #output, #set_backtrace, #test_file_line, #test_file_name, #test_id, #test_line_num, #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



201
202
203
204
205
206
207
# File 'lib/assert/result.rb', line 201

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



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

def self.name; 'Error'; end

.typeObject



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

def self.type; :error;  end