Class: Smartest::BeNilMatcher

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

Instance Method Summary collapse

Methods inherited from Matcher

#and, #or

Instance Method Details

#descriptionObject



375
376
377
# File 'lib/smartest/matchers.rb', line 375

def description
  "be nil"
end

#failure_messageObject



367
368
369
# File 'lib/smartest/matchers.rb', line 367

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

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


362
363
364
365
# File 'lib/smartest/matchers.rb', line 362

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

#negated_failure_messageObject



371
372
373
# File 'lib/smartest/matchers.rb', line 371

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