Class: Expect::ExpectationTarget Private
- Inherits:
-
Object
- Object
- Expect::ExpectationTarget
- Defined in:
- lib/expect/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
Create a new expection target.
-
#not_to(definition) ⇒ Boolean
Evaluate to a negative assertion.
-
#to(definition) ⇒ Boolean
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.
Create a new expection target
18 19 20 |
# File 'lib/expect/expectation_target.rb', line 18 def initialize(&actual) @actual = actual end |
Instance Method Details
#not_to(definition) ⇒ Boolean
Evaluate to a negative assertion.
40 41 42 |
# File 'lib/expect/expectation_target.rb', line 40 def not_to(definition) match?(definition).equal?(false) || fail(Failure) end |
#to(definition) ⇒ Boolean
Evaluate to a positive assertion.
29 30 31 |
# File 'lib/expect/expectation_target.rb', line 29 def to(definition) match?(definition) || fail(Failure) end |