From 61b48d8557042519889860a0f57a66fb233e1d23 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 22 May 2020 14:21:40 +0100 Subject: [PATCH] formulary: install tap if needed. This matches what `cask_loader` does and is low risk given we no longer allow tap pinning. Fixes #7626 --- Library/Homebrew/formulary.rb | 2 ++ Library/Homebrew/test/formulary_spec.rb | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index b01973fab6..8df05b8287 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -279,6 +279,8 @@ module Formulary end def load_file + tap.install unless tap.installed? + super rescue MethodDeprecatedError => e e.issues_url = tap.issues_url || tap.to_s diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb index 157b608050..71c6c610e1 100644 --- a/Library/Homebrew/test/formulary_spec.rb +++ b/Library/Homebrew/test/formulary_spec.rb @@ -227,7 +227,8 @@ describe Formulary do end end - it "raises an error if the Formula is not available" do + it "raises an error if the Formula is not available after tapping" do + expect_any_instance_of(Tap).to receive(:install) expect { described_class.to_rack("a/b/#{formula_name}") }.to raise_error(TapFormulaUnavailableError)