Use formula helper in tests
This commit is contained in:
parent
d57fe3eded
commit
e651e7662a
@ -148,7 +148,7 @@ class FormulaTests < Homebrew::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_formula_spec_integration
|
def test_formula_spec_integration
|
||||||
f = Class.new(Formula) do
|
f = formula do
|
||||||
homepage 'http://example.com'
|
homepage 'http://example.com'
|
||||||
url 'http://example.com/test-0.1.tbz'
|
url 'http://example.com/test-0.1.tbz'
|
||||||
mirror 'http://example.org/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'
|
mirror 'http://example.org/test-0.2.tbz'
|
||||||
sha256 TEST_SHA256
|
sha256 TEST_SHA256
|
||||||
end
|
end
|
||||||
end.new("test", Pathname.new(__FILE__).expand_path, :stable)
|
end
|
||||||
|
|
||||||
assert_equal 'http://example.com', f.homepage
|
assert_equal 'http://example.com', f.homepage
|
||||||
assert_version_equal '0.1', f.version
|
assert_version_equal '0.1', f.version
|
||||||
|
|||||||
@ -8,7 +8,7 @@ class FormulaValidationTests < Homebrew::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_cant_override_brew
|
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
|
assert_match %r{You cannot override Formula#brew}, e.message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user