diff options
| author | Mike McQuaid | 2016-08-10 08:48:30 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-08-10 09:40:39 +0100 |
| commit | d0251c1abc3d63513c8b07647607e3a5654caedb (patch) | |
| tree | b235ac3aa8fc51e891d2945018cd3082df60b273 /Library/Homebrew/test | |
| parent | ffd71d02e15d84a777b19bdc3183a64dfe162f9d (diff) | |
| download | brew-d0251c1abc3d63513c8b07647607e3a5654caedb.tar.bz2 | |
formulary: fix to_rack for fully-scoped references
Fixes the case where I have `mysql56` installed but do
`brew uninstall foo/bar/mysql56` which isn't a valid formula.
Fixes https://github.com/Homebrew/legacy-homebrew/issues/39883.
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/test_formulary.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_formulary.rb b/Library/Homebrew/test/test_formulary.rb index 7c7ad3e74..7a3ab65e0 100644 --- a/Library/Homebrew/test/test_formulary.rb +++ b/Library/Homebrew/test/test_formulary.rb @@ -111,6 +111,15 @@ class FormularyFactoryTest < Homebrew::TestCase def test_load_from_contents assert_kind_of Formula, Formulary.from_contents(@name, @path, @path.read) end + + def test_to_rack + assert_equal HOMEBREW_CELLAR/@name, Formulary.to_rack(@name) + (HOMEBREW_CELLAR/@name).mkpath + assert_equal HOMEBREW_CELLAR/@name, Formulary.to_rack(@name) + assert_raises(TapFormulaUnavailableError) { Formulary.to_rack("a/b/#{@name}") } + ensure + FileUtils.rm_rf HOMEBREW_CELLAR/@name + end end class FormularyTapFactoryTest < Homebrew::TestCase |
