Skip to content

Commit

Permalink
Verify behavior when formula is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
tt committed Nov 24, 2024
1 parent 8663a3f commit 876cda0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/bundle/commands/cleanup_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
expect(described_class.taps_to_untap).to eql(%w[z])
end

it "ignores unavailable formulae when computing which taps to keep" do
allow(Formulary).to receive(:factory).and_raise(TapFormulaUnavailableError)
allow(Bundle::TapDumper).to receive(:tap_names).and_return(%w[z homebrew/bundle homebrew/core homebrew/tap])
expect(described_class.taps_to_untap).to eql(%w[z homebrew/tap])
end

it "computes which VSCode extensions to uninstall" do
allow(Bundle::VscodeExtensionDumper).to receive(:extensions).and_return(%w[z])
expect(described_class.vscode_extensions_to_uninstall).to eql(%w[z])
Expand Down
3 changes: 3 additions & 0 deletions spec/stub/exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ class UsageError < RuntimeError

class FormulaUnavailableError < RuntimeError
end

class TapFormulaUnavailableError < RuntimeError
end

0 comments on commit 876cda0

Please sign in to comment.