Class: Spectre::Assertion::AndEvaluation

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

Instance Method Summary collapse

Methods inherited from Evaluation

#evaluate

Constructor Details

#initialize(val, other) ⇒ AndEvaluation

Returns a new instance of AndEvaluation.



218
219
220
221
# File 'lib/spectre/assertion.rb', line 218

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

Instance Method Details

#run(&block) ⇒ Object



223
224
225
226
227
# File 'lib/spectre/assertion.rb', line 223

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

#to_sObject



229
230
231
# File 'lib/spectre/assertion.rb', line 229

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