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 Attribute Summary (collapse)
-
- (Object) actual
Returns the value of attribute actual.
-
- (Object) expected
Returns the value of attribute expected.
Instance Method Summary (collapse)
- - (Boolean) actual_exists? private
- - (Boolean) valid_test? private
- - (String) validity_message private
Instance Attribute Details
- (Object) actual
Returns the value of attribute actual
43 44 45 |
# File 'lib/rspec/matchers/built_in/exist.rb', line 43 def actual @actual end |
- (Object) expected
Returns the value of attribute expected
43 44 45 |
# File 'lib/rspec/matchers/built_in/exist.rb', line 43 def expected @expected end |
Instance Method Details
- (Boolean) actual_exists?
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.
52 53 54 |
# File 'lib/rspec/matchers/built_in/exist.rb', line 52 def actual_exists? existence_values.first end |
- (Boolean) valid_test?
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.
46 47 48 |
# File 'lib/rspec/matchers/built_in/exist.rb', line 46 def valid_test? uniq_truthy_values.size == 1 end |
- (String) validity_message
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.
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/rspec/matchers/built_in/exist.rb', line 58 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 |