Yep, looks real enough to me. Confusion between "nil" and "false" in Ruby, where an assumed true/false return value actually takes on a third value that also matches a nil password.
unless foo
# ... foo can be false or nil to reach this branch
end
unless foo == false
# ... this branch is reached unless foo == false
end
Since terseness is considered such a cardinal virtue amongst Ruby programmers (including myself), however, this kind of issue is often ignored, and difficult to detect unless your tests explicitly check for "truthy" and "non-truthy" values in addition to the true/false literals. if object.nil?
puts "Object is nil!"
else
puts "Object is not nil."
end