Class: Spec::Matchers::Exist

Inherits:
Object
  • Object
show all
Defined in:
lib/spec/matchers/exist.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



18
19
20
# File 'lib/spec/matchers/exist.rb', line 18

def description
  "exists"
end

#failure_message_for_shouldObject



10
11
12
# File 'lib/spec/matchers/exist.rb', line 10

def failure_message_for_should
  "expected #{@actual.inspect} to exist, but it doesn't."
end

#failure_message_for_should_notObject



14
15
16
# File 'lib/spec/matchers/exist.rb', line 14

def failure_message_for_should_not
  "expected #{@actual.inspect} to not exist, but it does."
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
# File 'lib/spec/matchers/exist.rb', line 5

def matches?(actual)
  @actual = actual
  actual.exist?
end