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

#and, #initialize, #or

Constructor Details

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

Instance Method Details

#failure_messageObject



109
110
111
# File 'lib/crspec/matchers.rb', line 109

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

#failure_message_when_negatedObject



113
114
115
# File 'lib/crspec/matchers.rb', line 113

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

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


104
105
106
107
# File 'lib/crspec/matchers.rb', line 104

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