aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/test
diff options
context:
space:
mode:
authorMarkus Reiter2016-11-11 13:43:38 +0100
committerGitHub2016-11-11 13:43:38 +0100
commit8241bbb15b3b7270fa2b42904247925a1f1b4715 (patch)
tree6da5025ee1f9dd299c368b3062f4dddab2668982 /Library/Homebrew/cask/test
parent8fea516dcdc68680c4841d2547be209f16d32203 (diff)
parent8dd8273d5e4bb2dc2892535803a550bcfde46c95 (diff)
downloadbrew-8241bbb15b3b7270fa2b42904247925a1f1b4715.tar.bz2
Merge pull request #1475 from reitermarkus/fix-locations
Fix `Hbc::Locations` in tests.
Diffstat (limited to 'Library/Homebrew/cask/test')
-rw-r--r--Library/Homebrew/cask/test/support/fake_dirs.rb2
-rw-r--r--Library/Homebrew/cask/test/test_helper.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/Library/Homebrew/cask/test/support/fake_dirs.rb b/Library/Homebrew/cask/test/support/fake_dirs.rb
index f8e36bbbb..ea7acc685 100644
--- a/Library/Homebrew/cask/test/support/fake_dirs.rb
+++ b/Library/Homebrew/cask/test/support/fake_dirs.rb
@@ -8,7 +8,7 @@ module FakeDirHooks
@canned_dirs = {}
DIRS.each do |dir_name|
- dir = Hbc.homebrew_prefix.join("#{dir_name}-#{Time.now.to_i}-#{rand(1024)}")
+ dir = HOMEBREW_PREFIX.join("#{dir_name}-#{Time.now.to_i}-#{rand(1024)}")
dir.mkpath
Hbc.send("#{dir_name}=", dir)
@canned_dirs[:dir_name] = dir
diff --git a/Library/Homebrew/cask/test/test_helper.rb b/Library/Homebrew/cask/test/test_helper.rb
index 85024aae8..73459cb25 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