Class: Smartest::BeNilMatcher

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

Instance Method Summary collapse

Instance Method Details

#failure_messageObject



141
142
143
# File 'lib/smartest/matchers.rb', line 141

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

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


136
137
138
139
# File 'lib/smartest/matchers.rb', line 136

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

#negated_failure_messageObject



145
146
147
# File 'lib/smartest/matchers.rb', line 145

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