Module: Assert::Result

Defined in:
lib/assert/result.rb

Defined Under Namespace

Classes: Backtrace, Base, Error, Fail, Ignore, Pass, Skip

Constant Summary collapse

TestFailure =

raised by the ‘fail’ context helper to break test execution

Class.new(RuntimeError)
TestSkipped =

raised by the ‘skip’ context helper to break test execution

Class.new(RuntimeError)

Class Method Summary collapse

Class Method Details

.new(data = nil) ⇒ Object



23
24
25
26
# File 'lib/assert/result.rb', line 23

def self.new(data = nil)
  data ||= {}
  self.types[data[:type]].new(data)
end

.typesObject



13
14
15
16
17
18
19
20
21
# File 'lib/assert/result.rb', line 13

def self.types
  @types ||= Hash.new{ |h, k| Base }.tap do |hash|
    hash[:pass]   = Pass
    hash[:fail]   = Fail
    hash[:ignore] = Ignore
    hash[:skip]   = Skip
    hash[:error]  = Error
  end.freeze
end