Never link outdated cask fixtures.

This commit is contained in:
Markus Reiter 2024-02-09 22:04:26 +01:00
parent 55b4db3f43
commit d9263196a2
No known key found for this signature in database
GPG Key ID: 245293B51702655B
2 changed files with 10 additions and 4 deletions

View File

@ -25,7 +25,6 @@ describe Cask::Upgrade, :cask do
installed.each do |cask|
Cask::Installer.new(Cask::CaskLoader.load(cask_path(cask))).install
end
FileUtils.rm_rf CoreCaskTap.instance.cask_dir/"outdated"
allow_any_instance_of(described_class).to receive(:verbose?).and_return(true)
end

View File

@ -39,9 +39,16 @@ RSpec.shared_context "Homebrew Cask", :needs_macos do # rubocop:disable RSpec/Co
Cask::Config::DEFAULT_DIRS_PATHNAMES.each_value(&:mkpath)
CoreCaskTap.instance.tap do |tap|
tap.cask_dir.mkpath
(TEST_FIXTURE_DIR/"cask/Casks").children.each do |casks_path|
FileUtils.ln_sf casks_path, tap.cask_dir
fixture_cask_dir = TEST_FIXTURE_DIR/"cask/Casks"
fixture_cask_dir.glob("**/*.rb").each do |fixture_cask_path|
relative_cask_path = fixture_cask_path.relative_path_from(fixture_cask_dir)
# These are only used manually in tests since they
# would otherwise conflict with other casks.
next if relative_cask_path.dirname.basename.to_s == "outdated"
cask_dir = (tap.cask_dir/relative_cask_path.dirname).tap(&:mkpath)
FileUtils.ln_sf fixture_cask_path, cask_dir
end
end