diff options
| author | Markus Reiter | 2017-03-04 20:02:40 +0100 |
|---|---|---|
| committer | Markus Reiter | 2017-03-04 20:08:12 +0100 |
| commit | a1fbb1020bdfa5cad0659b466c4b236c7d37c789 (patch) | |
| tree | 7a68e1e521553cbe892daf1442b42f8d0d4fdc80 /Library/Homebrew/cask | |
| parent | 370c711da23fa0f7c7944f7d15928e44a67656a9 (diff) | |
| download | brew-a1fbb1020bdfa5cad0659b466c4b236c7d37c789.tar.bz2 | |
Simplify Cask `spec_helper`.
Diffstat (limited to 'Library/Homebrew/cask')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/locations.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/cask/spec/spec_helper.rb | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/locations.rb b/Library/Homebrew/cask/lib/hbc/locations.rb index 292b45d0c..4fb4a2191 100644 --- a/Library/Homebrew/cask/lib/hbc/locations.rb +++ b/Library/Homebrew/cask/lib/hbc/locations.rb @@ -15,6 +15,8 @@ module Hbc @default_caskroom ||= HOMEBREW_PREFIX.join("Caskroom") end + attr_writer :caskroom + def caskroom @caskroom ||= begin if Utils.path_occupied?(legacy_caskroom) @@ -36,14 +38,12 @@ module Hbc end end - def caskroom=(caskroom) - @caskroom = caskroom - end - def legacy_cache @legacy_cache ||= HOMEBREW_CACHE.join("Casks") end + attr_writer :cache + def cache @cache ||= HOMEBREW_CACHE.join("Cask") end diff --git a/Library/Homebrew/cask/spec/spec_helper.rb b/Library/Homebrew/cask/spec/spec_helper.rb index ea6a87f41..f7f3dbf41 100644 --- a/Library/Homebrew/cask/spec/spec_helper.rb +++ b/Library/Homebrew/cask/spec/spec_helper.rb @@ -1,4 +1,3 @@ -require "pathname" require "rspec/its" require "rspec/wait" @@ -22,9 +21,6 @@ Pathname.glob(HOMEBREW_LIBRARY_PATH.join("cask", "spec", "support", "**", "*.rb" require "hbc" # create and override default directories -Hbc.appdir = Pathname.new(TEST_TMPDIR).join("Applications").tap(&:mkpath) -Hbc.cache.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 @@ -37,6 +33,7 @@ FileUtils.ln_s Pathname.new(ENV["HOMEBREW_LIBRARY"]).join("Taps", "caskroom", "h HOMEBREW_CASK_DIRS = [ :appdir, :caskroom, + :cache, :prefpanedir, :qlplugindir, :servicedir, |
