Added tests for ARGV prune 'all'
This commit is contained in:
parent
c1799bb497
commit
5e17d63010
@ -163,5 +163,21 @@ describe Homebrew::Cleanup do
|
|||||||
|
|
||||||
expect(npm_cache).not_to exist
|
expect(npm_cache).not_to exist
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user