class RSpec::Matchers::BuiltIn::Exist
@api private Provides the implementation for `exist`. Not intended to be instantiated directly.
Public Class Methods
new(*expected)
click to toggle source
# File lib/rspec/matchers/built_in/exist.rb, line 8 def initialize(*expected) @expected = expected end
Public Instance Methods
does_not_match?(actual)
click to toggle source
@api private @return [Boolean]
# File lib/rspec/matchers/built_in/exist.rb, line 22 def does_not_match?(actual) @actual = actual @test = ExistenceTest.new @actual, @expected @test.valid_test? && !@test.actual_exists? end
failure_message()
click to toggle source
@api private @return [String]
# File lib/rspec/matchers/built_in/exist.rb, line 30 def failure_message "expected #{actual_formatted} to exist#{@test.validity_message}" end
failure_message_when_negated()
click to toggle source
@api private @return [String]
# File lib/rspec/matchers/built_in/exist.rb, line 36 def failure_message_when_negated "expected #{actual_formatted} not to exist#{@test.validity_message}" end
matches?(actual)
click to toggle source
@api private @return [Boolean]
# File lib/rspec/matchers/built_in/exist.rb, line 14 def matches?(actual) @actual = actual @test = ExistenceTest.new @actual, @expected @test.valid_test? && @test.actual_exists? end