From cf6ff4d84ce30d79b2247d95daff96f01b917793 Mon Sep 17 00:00:00 2001 From: William Ma Date: Mon, 22 Jun 2020 11:24:49 -0400 Subject: [PATCH] cache: add test for casks --- Library/Homebrew/test/cmd/--cache_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Library/Homebrew/test/cmd/--cache_spec.rb b/Library/Homebrew/test/cmd/--cache_spec.rb index 42b452ec60..fc467f5793 100644 --- a/Library/Homebrew/test/cmd/--cache_spec.rb +++ b/Library/Homebrew/test/cmd/--cache_spec.rb @@ -13,4 +13,18 @@ describe "brew --cache", :integration_test do .and not_to_output.to_stderr .and be_a_success end + + it "prints the cache files for a given Cask" do + expect { brew "--cache", cask_path("local-caffeine") } + .to output(%r{cask: #{HOMEBREW_CACHE}/downloads/[\da-f]{64}--caffeine\.zip}).to_stdout + .and not_to_output.to_stderr + .and be_a_success + end + + it "prints the cache files for a given Formula and Cask" do + expect { brew "--cache", testball, cask_path("local-caffeine") } + .to output(%r{#{HOMEBREW_CACHE}/downloads/[\da-f]{64}--testball-.*\ncask: #{HOMEBREW_CACHE}/downloads/[\da-f]{64}--caffeine\.zip}).to_stdout + .and not_to_output.to_stderr + .and be_a_success + end end