aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2015-08-06 21:25:42 +0800
committerXu Cheng2015-08-06 22:28:44 +0800
commit4e5227fd4efbebdceaee4c427aeb3e408e5fd339 (patch)
tree827a71e675ad56dfb869008af0ae053630921fda
parent68a5b1fe46e89b6d90baf7a13a3af3777a2e6e58 (diff)
downloadbrew-4e5227fd4efbebdceaee4c427aeb3e408e5fd339.tar.bz2
test_formula: add test_facotry_with_fully_qualified_name
Closes Homebrew/homebrew#42550. Signed-off-by: Xu Cheng <xucheng@me.com>
-rw-r--r--Library/Homebrew/test/test_formula.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb
index d61b0d820..24cf30e2b 100644
--- a/Library/Homebrew/test/test_formula.rb
+++ b/Library/Homebrew/test/test_formula.rb
@@ -228,6 +228,22 @@ class FormulaTests < Homebrew::TestCase
path.unlink
end
+ def test_factory_with_fully_qualified_name
+ name = "foo-bar"
+ path = HOMEBREW_PREFIX+"Library/Formula/#{name}.rb"
+ path.dirname.mkpath
+ File.open(path, "w") do |f|
+ f << %(
+ class #{Formulary.class_s(name)} < Formula
+ url 'foo-1.0'
+ end
+ )
+ end
+ assert_kind_of Formula, Formulary.factory("homebrew/homebrew/#{name}")
+ ensure
+ path.unlink
+ end
+
def test_class_specs_are_always_initialized
f = formula { url "foo-1.0" }