Class: Matchy::Expectations::ExistExpectation
- Defined in:
- lib/matchy/built_in/truth_expectations.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(test_case) ⇒ ExistExpectation
constructor
A new instance of ExistExpectation.
- #matches?(receiver) ⇒ Boolean
- #negative_failure_message ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(test_case) ⇒ ExistExpectation
Returns a new instance of ExistExpectation.
57 58 59 |
# File 'lib/matchy/built_in/truth_expectations.rb', line 57 def initialize(test_case) @test_case = test_case end |
Instance Method Details
#failure_message ⇒ Object
66 67 68 |
# File 'lib/matchy/built_in/truth_expectations.rb', line 66 def "Expected #{@receiver.inspect} to exist." end |
#matches?(receiver) ⇒ Boolean
61 62 63 64 |
# File 'lib/matchy/built_in/truth_expectations.rb', line 61 def matches?(receiver) @receiver = receiver receiver.exist? end |
#negative_failure_message ⇒ Object
70 71 72 |
# File 'lib/matchy/built_in/truth_expectations.rb', line 70 def "Expected #{@receiver.inspect} to not exist." end |