Class: Assert::Result::Skip

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

skip results are generated by raising Assert::Result::TestSkipped


255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/assert/result.rb', line 255

def self.for_test(test, msg_or_err, bt = nil)
  if msg_or_err.is_a?(TestSkipped)
    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.is_a?(Exception)
    raise(
      ArgumentError,
      "generate skip results by raising Assert::Result::TestSkipped",
    )
  else
    super(test, msg_or_err, bt)
  end
end

.nameObject


250
251
252
# File 'lib/assert/result.rb', line 250

def self.name
  "Skip"
end

.typeObject


246
247
248
# File 'lib/assert/result.rb', line 246

def self.type
  :skip
end