Class: Crspec::Matchers::BeNilMatcher

Inherits:
BaseMatcher show all
Defined in:
lib/crspec/matchers.rb

Instance Attribute Summary

Attributes inherited from BaseMatcher

#actual, #expected

Instance Method Summary collapse

Methods inherited from BaseMatcher

#initialize

Constructor Details

This class inherits a constructor from Crspec::Matchers::BaseMatcher

Instance Method Details

#failure_messageObject



59
60
61
# File 'lib/crspec/matchers.rb', line 59

def failure_message
  "Expected #{@actual.inspect} to be nil"
end

#failure_message_when_negatedObject



63
64
65
# File 'lib/crspec/matchers.rb', line 63

def failure_message_when_negated
  "Expected #{@actual.inspect} not to be nil"
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


54
55
56
57
# File 'lib/crspec/matchers.rb', line 54

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