Use formula helper in tests

This commit is contained in:
Jack Nagel 2014-12-28 21:43:04 -05:00
parent d57fe3eded
commit e651e7662a
2 changed files with 3 additions and 3 deletions

View File

@ -148,7 +148,7 @@ class FormulaTests < Homebrew::TestCase
end
def test_formula_spec_integration
f = Class.new(Formula) do
f = formula do
homepage 'http://example.com'
url 'http://example.com/test-0.1.tbz'
mirror 'http://example.org/test-0.1.tbz'
@ -161,7 +161,7 @@ class FormulaTests < Homebrew::TestCase
mirror 'http://example.org/test-0.2.tbz'
sha256 TEST_SHA256
end
end.new("test", Pathname.new(__FILE__).expand_path, :stable)
end
assert_equal 'http://example.com', f.homepage
assert_version_equal '0.1', f.version

View File

@ -8,7 +8,7 @@ class FormulaValidationTests < Homebrew::TestCase
end
def test_cant_override_brew
e = assert_raises(RuntimeError) { Class.new(Formula) { def brew; end } }
e = assert_raises(RuntimeError) { formula { def brew; end } }
assert_match %r{You cannot override Formula#brew}, e.message
end