aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/test_formula.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb
index 07da0aa32..900d7272c 100644
--- a/Library/Homebrew/test/test_formula.rb
+++ b/Library/Homebrew/test/test_formula.rb
@@ -248,4 +248,14 @@ class FormulaTests < Homebrew::TestCase
assert_equal PkgVersion.parse('HEAD'), f.pkg_version
end
+
+ def test_raises_when_non_formula_constant_exists
+ const = :SomeConst
+ Object.const_set(const, Module.new)
+ begin
+ assert_raises(FormulaUnavailableError) { Formulary.factory("some_const") }
+ ensure
+ Object.send(:remove_const, const)
+ end
+ end
end