Class: RSpec::Matchers::BuiltIn::Exist::ExistenceTest Private
- Inherits:
-
Struct
- Object
- Struct
- RSpec::Matchers::BuiltIn::Exist::ExistenceTest
- Defined in:
- lib/rspec/matchers/built_in/exist.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.
Simple class for memoizing actual/expected for this matcher and examining the match
Instance Method Summary collapse
- #actual_exists? ⇒ Boolean private
- #valid_test? ⇒ Boolean private
- #validity_message ⇒ String private
Instance Method Details
#actual_exists? ⇒ Boolean
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.
55 56 57 |
# File 'lib/rspec/matchers/built_in/exist.rb', line 55 def actual_exists? existence_values.first end |
#valid_test? ⇒ Boolean
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.
49 50 51 |
# File 'lib/rspec/matchers/built_in/exist.rb', line 49 def valid_test? uniq_truthy_values.size == 1 end |
#validity_message ⇒ String
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.
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/rspec/matchers/built_in/exist.rb', line 61 def case uniq_truthy_values.size when 0 " but it does not respond to either `exist?` or `exists?`" when 2 " but `exist?` and `exists?` returned different values:\n\n"\ " exist?: #{existence_values.first}\n"\ "exists?: #{existence_values.last}" end end |