Class: RCheck::Assertions::AbstractAssert

Inherits:
Abstract
  • Object
show all
Defined in:
lib/rcheck/assertions.rb

Direct Known Subclasses

Assert, Refute

Instance Attribute Summary

Attributes inherited from Abstract

#result

Instance Method Summary collapse

Methods inherited from Abstract

#debuggers, #inspect

Constructor Details

#initialize(left, op = nil, *right) ⇒ AbstractAssert

Returns a new instance of AbstractAssert.



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/rcheck/assertions.rb', line 55

def initialize(left, op=nil, *right)
  @left      = left
  @op        = op
  @right     = right
  @truth     = (@right.empty? && @op.nil?) ?
    @left : @left.send(@op, *@right)

  @result = Result.new(
    status:         !!@truth != !!@refute ? :pass : :fail,
    location:       caller(4),
    introspection:  introspection)
end