aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/cleanup_spec.rb
diff options
context:
space:
mode:
authormansimarkaur2017-07-19 02:46:45 +0530
committermansimarkaur2017-08-27 01:18:40 +0530
commit5e17d63010c74dd23f02222feb61b76f515908d4 (patch)
tree4f7d8c33844a666ad5171793b1c3edea527570db /Library/Homebrew/test/cleanup_spec.rb
parentc1799bb49712b9362b54e8bccae1e721ce6542e0 (diff)
downloadbrew-5e17d63010c74dd23f02222feb61b76f515908d4.tar.bz2
Added tests for ARGV prune 'all'
Diffstat (limited to 'Library/Homebrew/test/cleanup_spec.rb')
-rw-r--r--Library/Homebrew/test/cleanup_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/Library/Homebrew/test/cleanup_spec.rb b/Library/Homebrew/test/cleanup_spec.rb
index 81cd63147..f1a6e770e 100644
--- a/Library/Homebrew/test/cleanup_spec.rb
+++ b/Library/Homebrew/test/cleanup_spec.rb
@@ -163,5 +163,21 @@ describe Homebrew::Cleanup do
expect(npm_cache).not_to exist
end
+
+ it "cleans up files and directories with name containing -- if ARGV prune is all" do
+ a = (HOMEBREW_CACHE/"--a")
+ b = (HOMEBREW_CACHE/"b")
+ c = (HOMEBREW_CACHE/"c")
+ a.mkpath
+ b.mkpath
+ FileUtils.touch c
+ allow(ARGV).to receive(:value).with("prune").and_return("all")
+ shutup do
+ described_class.cleanup_cache
+ end
+ expect(a).not_to exist
+ expect(b).to exist
+ expect(c).not_to exist
+ end
end
end