Skip to content

Commit f3d44d8

Browse files
committed
Fix tests
1 parent 85e473b commit f3d44d8

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Library/Homebrew/formula.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2558,7 +2558,7 @@ def runtime_installed_formula_dependents
25582558
sig { params(hide: T::Array[String]).returns(T::Array[Dependency]) }
25592559
def missing_dependencies(hide: [])
25602560
runtime_dependencies(read_from_tab: true, undeclared: true).select do |f|
2561-
hide.include?(f.name) || !f.installed?
2561+
hide.include?(f.name) || f.to_installed_formula.installed_prefixes.none?
25622562
end
25632563
# If we're still getting unavailable formulae at this stage the best we can
25642564
# do is just return no results.

Library/Homebrew/formulary.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ def self.try_new(ref, from: nil, warn: false)
944944
keg = Keg.new(keg_directory)
945945
return unless (keg_formula = HOMEBREW_PREFIX/"opt/#{ref}/.brew/#{keg.name}.rb").file?
946946

947-
new(keg.name, keg_formula)
947+
new(keg.name, keg_formula, tap: keg.tab.tap)
948948
end
949949
end
950950

Library/Homebrew/installed_dependents.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def find_some_installed_dependents(kegs, casks: [])
2626
kegs_by_source = kegs.group_by do |keg|
2727
# First, attempt to resolve the keg to a formula
2828
# to get up-to-date name and tap information.
29-
f = keg.to_installed_formula
29+
f = keg.to_formula
3030
keg_formulae << f
3131
[f.name, f.tap]
3232
rescue
@@ -47,7 +47,7 @@ def find_some_installed_dependents(kegs, casks: [])
4747
dependent.missing_dependencies(hide: keg_names).map(&:to_installed_formula)
4848
when Cask::Cask
4949
# When checking for cask dependents, we don't care about missing or non-runtime dependencies
50-
CaskDependent.new(dependent).runtime_dependencies
50+
CaskDependent.new(dependent).runtime_dependencies.map(&:to_installed_formula)
5151
end
5252

5353
required_kegs = required.filter_map do |f|

Library/Homebrew/test/support/helper/formula.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def formula(name = "formula_name", path: nil, spec: :stable, alias_path: nil, ta
1515
def stub_formula_loader(formula, ref = formula.full_name, call_original: false)
1616
allow(Formulary).to receive(:loader_for).and_call_original if call_original
1717

18-
loader = instance_double(Formulary::FormulaLoader, get_formula: formula)
18+
loader = instance_double(Formulary::FormulaLoader, get_formula: formula, name: formula.name)
1919
allow(Formulary).to receive(:loader_for).with(ref, any_args).and_return(loader)
2020
end
2121
end

0 commit comments

Comments
 (0)