Cask: Ensure #discontinued? returns a boolean

The `Cask::DSL#discontinued?` method is expected to return a boolean
value (`true`/`false`) but it will return `nil` for any casks without
a `caveats` block. `nil` is still falsy but this commit ensures that
the method will properly return a boolean value in this scenario.
This commit is contained in:
Sam Ford 2022-06-22 09:47:59 -04:00
parent a64f04f678
commit 04203953de
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D

View File

@ -281,7 +281,7 @@ module Cask
end
def discontinued?
@caveats&.discontinued?
@caveats&.discontinued? == true
end
# @api public