Class: Spectre::Assertion::OrWrapper

Inherits:
ValueWrapper show all
Defined in:
lib/spectre/assertion.rb

Instance Method Summary collapse

Methods inherited from ValueWrapper

wrap

Constructor Details

#initialize(first, second) ⇒ OrWrapper

Returns a new instance of OrWrapper.



28
29
30
31
32
# File 'lib/spectre/assertion.rb', line 28

def initialize first, second
  super(first)
  @first = ValueWrapper.wrap(first)
  @second = ValueWrapper.wrap(second)
end

Instance Method Details

#evaluate?(predicate, actual, negate) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/spectre/assertion.rb', line 34

def evaluate? predicate, actual, negate
  @first.evaluate?(predicate, actual, negate) or @second.evaluate?(predicate, actual, negate)
end

#to_sObject

:nodoc:



39
40
41
# File 'lib/spectre/assertion.rb', line 39

def to_s
  "#{@first} or #{@second}"
end