aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_formula.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test/test_formula.rb')
-rw-r--r--Library/Homebrew/test/test_formula.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb
index bc1e703eb..00f929e4b 100644
--- a/Library/Homebrew/test/test_formula.rb
+++ b/Library/Homebrew/test/test_formula.rb
@@ -212,4 +212,30 @@ class FormulaTests < Test::Unit::TestCase
ensure
path.unlink
end
+
+ def test_class_specs_are_always_initialized
+ f = formula { url 'foo-1.0' }
+
+ %w{stable devel head bottle}.each do |spec|
+ assert_kind_of SoftwareSpec, f.class.send(spec)
+ end
+ end
+
+ def test_incomplete_instance_specs_are_not_accessible
+ f = formula { url 'foo-1.0' }
+
+ %w{devel head bottle}.each { |spec| assert_nil f.send(spec) }
+ end
+
+ def test_honors_attributes_declared_before_specs
+ f = formula do
+ url 'foo-1.0'
+ depends_on 'foo'
+ devel { url 'foo-1.1' }
+ end
+
+ %w{stable devel head bottle}.each do |spec|
+ assert_equal 'foo', f.class.send(spec).deps.first.name
+ end
+ end
end