class RSpec::Matchers::BuiltIn::Exist

@api private Provides the implementation for ‘exist`. Not intended to be instantiated directly.

Public Class Methods

# File rspec-expectations/lib/rspec/matchers/built_in/exist.rb, line 8
def initialize(*expected)
  @expected = expected
end

Public Instance Methods

@api private @return [Boolean]

# File rspec-expectations/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

@api private @return [String]

# File rspec-expectations/lib/rspec/matchers/built_in/exist.rb, line 30
def failure_message
  "expected #{actual_formatted} to exist#{@test.validity_message}"
end

@api private @return [String]

# File rspec-expectations/lib/rspec/matchers/built_in/exist.rb, line 36
def failure_message_when_negated
  "expected #{actual_formatted} not to exist#{@test.validity_message}"
end

@api private @return [Boolean]

# File rspec-expectations/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