Class: Smartest::BeNilMatcher

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

Instance Method Summary collapse

Instance Method Details

#failure_messageObject



68
69
70
# File 'lib/smartest/matchers.rb', line 68

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

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#negated_failure_messageObject



72
73
74
# File 'lib/smartest/matchers.rb', line 72

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