Class: Spectus::ExpectationTarget Private
- Inherits:
-
Object
- Object
- Spectus::ExpectationTarget
- Defined in:
- lib/spectus/expectation_target.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Wraps the target of an expectation.
Instance Method Summary collapse
-
#initialize(&actual) ⇒ ExpectationTarget
constructor
private
A new instance of ExpectationTarget.
-
#not_to(definition) ⇒ Object
Evaluate to a negative assertion.
-
#to(definition) ⇒ Object
Evaluate to a positive assertion.
Constructor Details
#initialize(&actual) ⇒ ExpectationTarget
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ExpectationTarget.
10 11 12 13 14 |
# File 'lib/spectus/expectation_target.rb', line 10 def initialize &actual @actual = actual freeze end |
Instance Method Details
#not_to(definition) ⇒ Object
Evaluate to a negative assertion.
30 31 32 |
# File 'lib/spectus/expectation_target.rb', line 30 def not_to definition Matcher.eval true, definition, &@actual end |
#to(definition) ⇒ Object
Evaluate to a positive assertion.
21 22 23 |
# File 'lib/spectus/expectation_target.rb', line 21 def to definition Matcher.eval false, definition, &@actual end |