From 0f673cc27f10375bcc8d88a4b85908e7acb7cd48 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Thu, 10 Nov 2016 14:48:14 +0100 Subject: [PATCH] Ensure `Hbc.caskroom` in tests does not use `legacy_caskroom`. --- Library/Homebrew/cask/spec/spec_helper.rb | 2 +- Library/Homebrew/cask/test/test_helper.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/spec/spec_helper.rb b/Library/Homebrew/cask/spec/spec_helper.rb index 1e41e3de43..7e72a2cee5 100644 --- a/Library/Homebrew/cask/spec/spec_helper.rb +++ b/Library/Homebrew/cask/spec/spec_helper.rb @@ -29,7 +29,7 @@ end # create and override default directories Hbc.appdir = Pathname.new(TEST_TMPDIR).join("Applications").tap(&:mkpath) Hbc.cache.mkpath -Hbc.caskroom.mkpath +Hbc.caskroom = Hbc.default_caskroom.tap(&:mkpath) Hbc.default_tap = Tap.fetch("caskroom", "spec").tap do |tap| # link test casks FileUtils.mkdir_p tap.path.dirname diff --git a/Library/Homebrew/cask/test/test_helper.rb b/Library/Homebrew/cask/test/test_helper.rb index 85024aae86..73459cb25c 100644 --- a/Library/Homebrew/cask/test/test_helper.rb +++ b/Library/Homebrew/cask/test/test_helper.rb @@ -41,8 +41,10 @@ module Hbc class TestCask < Cask; end end +# create and override default directories +Hbc.appdir = Pathname.new(TEST_TMPDIR).join("Applications").tap(&:mkpath) Hbc.cache.mkpath -Hbc.caskroom.mkpath +Hbc.caskroom = Hbc.default_caskroom.tap(&:mkpath) Hbc.default_tap = Tap.fetch("caskroom", "test").tap do |tap| # link test casks FileUtils.mkdir_p tap.path.dirname