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, #set_with_bt, #src_line, #test_file_line, #test_file_name, #test_id, #test_line_num, #test_name, #to_s, #to_sym, #trace, #type, #with_bt_set?

Constructor Details

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

Class Method Details

.for_test(test, err) ⇒ Object

error results are generated by raising exceptions in tests



225
226
227
228
229
230
231
# File 'lib/assert/result.rb', line 225

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

.nameObject



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

def self.name; "Error"; end

.typeObject



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

def self.type; :error;  end