Class: Spectre::Assertion::AndWrapper
- Inherits:
-
ValueWrapper
- Object
- ValueWrapper
- Spectre::Assertion::AndWrapper
- Defined in:
- lib/spectre/assertion.rb
Instance Method Summary collapse
- #evaluate?(predicate, actual, negate) ⇒ Boolean
-
#initialize(first, second) ⇒ AndWrapper
constructor
A new instance of AndWrapper.
-
#to_s ⇒ Object
:nodoc:.
Methods inherited from ValueWrapper
Constructor Details
#initialize(first, second) ⇒ AndWrapper
Returns a new instance of AndWrapper.
45 46 47 48 49 |
# File 'lib/spectre/assertion.rb', line 45 def initialize first, second super(first) @first = ValueWrapper.wrap(first) @second = ValueWrapper.wrap(second) end |
Instance Method Details
#evaluate?(predicate, actual, negate) ⇒ Boolean
51 52 53 |
# File 'lib/spectre/assertion.rb', line 51 def evaluate? predicate, actual, negate @first.evaluate?(predicate, actual, negate) and @second.evaluate?(predicate, actual, negate) end |
#to_s ⇒ Object
:nodoc:
56 57 58 |
# File 'lib/spectre/assertion.rb', line 56 def to_s "#{@first} and #{@second}" end |