Class: Spectre::Assertion::AndEvaluation
- Inherits:
-
Evaluation
- Object
- Evaluation
- Spectre::Assertion::AndEvaluation
- Defined in:
- lib/spectre/assertion.rb
Instance Method Summary collapse
-
#initialize(val, other) ⇒ AndEvaluation
constructor
A new instance of AndEvaluation.
- #run(&block) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Evaluation
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_s ⇒ Object
229 230 231 |
# File 'lib/spectre/assertion.rb', line 229 def to_s "(#{@val} and #{@other})" end |