diff options
| author | Alyssa Ross | 2016-12-27 17:26:21 +0000 |
|---|---|---|
| committer | Alyssa Ross | 2016-12-27 18:03:05 +0000 |
| commit | e5d7e13c63e7e942f3acdd5c0fac7bed624f52c4 (patch) | |
| tree | 6c69f7425fec3c2fbd4994ab3b9438d892501ff9 /Library/Homebrew/test | |
| parent | 0a20edf9454423537a7f4d3b3659ad56f0151775 (diff) | |
| download | brew-e5d7e13c63e7e942f3acdd5c0fac7bed624f52c4.tar.bz2 | |
keg: installed dependencies of unknown formulae
Previously, trying to resolve the dependencies of a keg would raise an
exception if the formulae for any of the dependencies could not be found
(e.g. if it had been moved to another tap).
This commit updates the dependency finding logic to catch these
exceptions, and fall back to comparing names and taps of formulae, which
should give the correct behaviour.
Fixes #1586.
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/keg_test.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Library/Homebrew/test/keg_test.rb b/Library/Homebrew/test/keg_test.rb index b875c7205..cf5f13a6c 100644 --- a/Library/Homebrew/test/keg_test.rb +++ b/Library/Homebrew/test/keg_test.rb @@ -47,6 +47,11 @@ class LinkTestCase < Homebrew::TestCase end class LinkTests < LinkTestCase + def test_all + Formula.clear_racks_cache + assert_equal [@keg], Keg.all + end + def test_empty_installation %w[.DS_Store INSTALL_RECEIPT.json LICENSE.txt].each do |file| touch @keg/file @@ -355,10 +360,11 @@ class InstalledDependantsTests < LinkTestCase # from a file path or URL. def test_unknown_formula Formulary.unstub(:loader_for) - dependencies [] + alter_tab { |t| t.source["tap"] = "some/tap" } + dependencies [{ "full_name" => "some/tap/bar", "version" => "1.0" }] alter_tab { |t| t.source["path"] = nil } - assert_empty @keg.installed_dependents - assert_nil Keg.find_some_installed_dependents([@keg]) + assert_equal [@dependent], @keg.installed_dependents + assert_equal [[@keg], ["bar 1.0"]], Keg.find_some_installed_dependents([@keg]) end def test_no_dependencies_anywhere |
