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. This class is responsible for reporting if the expectation is true or false.
Instance Attribute Summary collapse
- #actual ⇒ Object readonly private
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 Attribute Details
#actual ⇒ Object (readonly)
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.
22 23 24 |
# File 'lib/expect/expectation_target.rb', line 22 def actual @actual end |
Instance Method Details
#not_to(definition) ⇒ Boolean
Evaluate to a negative assertion.
42 43 44 |
# File 'lib/expect/expectation_target.rb', line 42 def not_to(definition) !to(definition) end |
#to(definition) ⇒ Boolean
Evaluate to a positive assertion.
31 32 33 |
# File 'lib/expect/expectation_target.rb', line 31 def to(definition) matcher(definition).matches?(&actual) end |