test/bundle/whalebrew_installer: fix flaky test from missing resets

This commit is contained in:
Bo Anderson 2025-03-30 19:29:42 +01:00
parent c273d8b467
commit f69ff29d93
No known key found for this signature in database

View File

@ -10,6 +10,11 @@ RSpec.describe Homebrew::Bundle::WhalebrewInstaller do
end end
describe ".installed_images" do describe ".installed_images" do
before do
described_class.reset!
Homebrew::Bundle::WhalebrewDumper.reset!
end
it "shells out" do it "shells out" do
expect { described_class.installed_images }.not_to raise_error expect { described_class.installed_images }.not_to raise_error
end end
@ -55,6 +60,7 @@ RSpec.describe Homebrew::Bundle::WhalebrewInstaller do
context "when whalebrew is installed" do context "when whalebrew is installed" do
before do before do
described_class.reset! described_class.reset!
Homebrew::Bundle::WhalebrewDumper.reset!
allow(Homebrew::Bundle).to receive(:whalebrew_installed?).and_return(true) allow(Homebrew::Bundle).to receive(:whalebrew_installed?).and_return(true)
allow(Homebrew::Bundle).to receive(:system).with("whalebrew", "install", "whalebrew/wget", verbose: false) allow(Homebrew::Bundle).to receive(:system).with("whalebrew", "install", "whalebrew/wget", verbose: false)
.and_return(true) .and_return(true)