Class: Spectre::Assertion::OrEvaluation

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

Instance Method Summary collapse

Methods inherited from Evaluation

#evaluate

Constructor Details

#initialize(val, other) ⇒ OrEvaluation

Returns a new instance of OrEvaluation.



201
202
203
204
# File 'lib/spectre/assertion.rb', line 201

def initialize val, other
  @val = val
  @other = other
end

Instance Method Details

#run(&block) ⇒ Object



206
207
208
209
210
# File 'lib/spectre/assertion.rb', line 206

def run &block
  res1 = evaluate(@val, block)
  res2 = evaluate(@other, block)
  res1 or res2
end

#to_sObject



212
213
214
# File 'lib/spectre/assertion.rb', line 212

def to_s
  "(#{@val} or #{@other})"
end