Class: Assert::Result::Fail

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, msg_or_err, bt = nil) ⇒ Object

fail results can be generated manually or by raising Assert::Result::TestFailure



193
194
195
196
197
198
199
200
201
202
203
# File 'lib/assert/result.rb', line 193

def self.for_test(test, msg_or_err, bt = nil)
  if msg_or_err.kind_of?(TestFailure)
    super(test, msg_or_err.message, msg_or_err.backtrace).tap do |result|
      result.set_with_bt(msg_or_err.assert_with_bt)
    end
  elsif msg_or_err.kind_of?(Exception)
    raise ArgumentError, "generate fail results by raising Assert::Result::TestFailure"
  else
    super(test, msg_or_err, bt)
  end
end

.nameObject



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

def self.name; 'Fail'; end

.typeObject



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

def self.type; :fail;  end