Fix loading test fixtures.

This commit is contained in:
Markus Reiter 2024-02-09 19:28:45 +01:00
parent 6f28392d6e
commit 0211feebd7
No known key found for this signature in database
GPG Key ID: 245293B51702655B

View File

@ -440,6 +440,10 @@ module Cask
# Loader which tries loading casks from tap paths, failing
# if the same token exists in multiple taps.
class FromNameLoader < FromPathLoader
sig {
params(ref: T.any(String, Pathname, Cask, URI::Generic), warn: T::Boolean)
.returns(T.nilable(T.attached_class))
}
def self.try_new(ref, warn: false)
return unless ref.is_a?(String)
return if ref.include?("/")
@ -473,7 +477,13 @@ module Cask
# Loader which loads a cask from the installed cask file.
class FromInstalledPathLoader < FromPathLoader
sig {
params(ref: T.any(String, Pathname, Cask, URI::Generic), warn: T::Boolean)
.returns(T.nilable(T.attached_class))
}
def self.try_new(ref, warn: false)
return unless ref.is_a?(String)
possible_installed_cask = Cask.new(ref)
return unless (installed_caskfile = possible_installed_cask.installed_caskfile)