Skip to content

Commit e0c6bea

Browse files
Spec for installing a cask not mutating
1 parent a59ce9d commit e0c6bea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Library/Homebrew/test/bundle/cask_installer_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292

9393
context "when cask is not installed" do
9494
before do
95-
allow(described_class).to receive(:installed_casks).and_return([])
95+
described_class.reset!
96+
allow(Homebrew::Bundle::CaskDumper).to receive(:cask_names).and_return([])
9697
end
9798

9899
it "installs cask" do
@@ -101,6 +102,9 @@
101102
.and_return(true)
102103
expect(described_class.preinstall!("google-chrome")).to be(true)
103104
expect(described_class.install!("google-chrome")).to be(true)
105+
106+
# Does not mutate CaskDumper's list of installed casks
107+
expect(Homebrew::Bundle::CaskDumper.cask_names).to eq([])
104108
end
105109

106110
it "installs cask with arguments" do

0 commit comments

Comments
 (0)