aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_formula.rb
diff options
context:
space:
mode:
authorJack Nagel2013-04-10 22:14:53 -0500
committerJack Nagel2013-04-10 22:27:56 -0500
commitf3272fe14ba89df4bcb293ee02ffe01929a5762c (patch)
tree505bcc8f378a17bd12c4bec680ce051103f051b7 /Library/Homebrew/test/test_formula.rb
parent8a7cfb071d04cd7a993a23c921c9714246264276 (diff)
downloadhomebrew-f3272fe14ba89df4bcb293ee02ffe01929a5762c.tar.bz2
Eliminate test_bucket
Most of the behavior tested here is now tested elsewhere. Move the remaining useful tests to better places.
Diffstat (limited to 'Library/Homebrew/test/test_formula.rb')
-rw-r--r--Library/Homebrew/test/test_formula.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb
index aafc91d23..30ef41589 100644
--- a/Library/Homebrew/test/test_formula.rb
+++ b/Library/Homebrew/test/test_formula.rb
@@ -272,4 +272,29 @@ class FormulaTests < Test::Unit::TestCase
assert_version_equal '1.0', f.version
assert_instance_of scheme, f.version
end
+
+ def test_formula_funcs
+ foobar = 'foo-bar'
+ path = Formula.path(foobar)
+
+ assert_match Regexp.new("^#{HOMEBREW_PREFIX}/Library/Formula"),
+ path.to_s
+
+ path = HOMEBREW_PREFIX+"Library/Formula/#{foobar}.rb"
+ path.dirname.mkpath
+ File.open(path, 'w') do |f|
+ f << %{
+ require 'formula'
+ class #{Formula.class_s(foobar)} < Formula
+ url ''
+ def initialize(*args)
+ @homepage = 'http://example.com/'
+ super
+ end
+ end
+ }
+ end
+
+ assert_not_nil Formula.factory(foobar)
+ end
end