Class: Smartest::BeNilMatcher

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

Instance Method Summary collapse

Instance Method Details

#descriptionObject



220
221
222
# File 'lib/smartest/matchers.rb', line 220

def description
  "be nil"
end

#failure_messageObject



212
213
214
# File 'lib/smartest/matchers.rb', line 212

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

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


207
208
209
210
# File 'lib/smartest/matchers.rb', line 207

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

#negated_failure_messageObject



216
217
218
# File 'lib/smartest/matchers.rb', line 216

def negated_failure_message
  "expected #{@actual.inspect} not to be nil"
end