From 4e5227fd4efbebdceaee4c427aeb3e408e5fd339 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Thu, 6 Aug 2015 21:25:42 +0800 Subject: [PATCH] test_formula: add test_facotry_with_fully_qualified_name Closes Homebrew/homebrew#42550. Signed-off-by: Xu Cheng --- Library/Homebrew/test/test_formula.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb index d61b0d8204..24cf30e2bf 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" }