Skip to content

Commit

Permalink
formula_installer: fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocab committed May 3, 2024
1 parent 5222c9e commit e56342a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Library/Homebrew/test/formula_installer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,12 @@ class #{Formulary.class_s(f_name)} < Formula
end

describe "#forbidden_tap_check" do
before do
allow(Homebrew::EnvConfig).to receive(:forbidden_taps).and_return("homebrew/forbidden")
end

it "raises on forbidden tap on formula" do
ENV["HOMEBREW_FORBIDDEN_TAPS"] = f_tap = "homebrew/forbidden"
f_tap = "homebrew/forbidden"
f_name = "homebrew-forbidden-tap"
f_path = Tap.fetch(f_tap).new_formula_path(f_name)
f_path.parent.mkpath
Expand All @@ -282,7 +286,7 @@ class #{Formulary.class_s(f_name)} < Formula
end

it "raises on forbidden tap on dependency" do
ENV["HOMEBREW_FORBIDDEN_TAPS"] = dep_tap = "homebrew/forbidden"
dep_tap = "homebrew/forbidden"
dep_name = "homebrew-forbidden-dependency-tap"
dep_path = Tap.fetch(dep_tap).new_formula_path(dep_name)
dep_path.parent.mkpath
Expand Down Expand Up @@ -310,7 +314,7 @@ class #{Formulary.class_s(f_name)} < Formula

expect do
fi.forbidden_tap_check
end.to raise_error(CannotInstallFormulaError, /but the #{dep_tap} tap was forbidden/)
end.to raise_error(CannotInstallFormulaError, /from the #{dep_tap} tap but/)
ensure
dep_path.parent.parent.rmtree
end
Expand Down

0 comments on commit e56342a

Please sign in to comment.