Skip to content

Commit fd80dd9

Browse files
committed
Fix test failure
1 parent 0fd3b8e commit fd80dd9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Library/Homebrew/test/utils/git_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@
186186
unless ENV["HOMEBREW_TEST_GENERIC_OS"]
187187
it "installs git" do
188188
expect(described_class).to receive(:available?).and_return(false)
189-
allow_any_instance_of(Formula).to receive(:ensure_installed!)
189+
allow(CoreTap.instance).to receive(:installed?).and_return(true)
190+
formula_double = instance_double(Formula)
191+
allow(Formula).to receive(:[]).with("git").and_return(formula_double)
192+
allow(formula_double).to receive(:ensure_installed!).and_return(formula_double)
190193
expect(described_class).to receive(:available?).and_return(true)
191194

192195
described_class.ensure_installed!

0 commit comments

Comments
 (0)