Raise a useful exception for incomplete formulae
This commit is contained in:
parent
25c0ecfd63
commit
a05bb48807
@ -73,9 +73,11 @@ class Formula
|
|||||||
when @head && ARGV.build_head? then @head # --HEAD
|
when @head && ARGV.build_head? then @head # --HEAD
|
||||||
when @devel && ARGV.build_devel? then @devel # --devel
|
when @devel && ARGV.build_devel? then @devel # --devel
|
||||||
when @bottle && install_bottle?(self) then @bottle # bottle available
|
when @bottle && install_bottle?(self) then @bottle # bottle available
|
||||||
|
when @stable then @stable
|
||||||
when @devel && @stable.nil? then @devel # devel-only
|
when @devel && @stable.nil? then @devel # devel-only
|
||||||
when @head && @stable.nil? then @head # head-only
|
when @head && @stable.nil? then @head # head-only
|
||||||
else @stable
|
else
|
||||||
|
raise "Formulae require at least a URL"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -77,4 +77,9 @@ class FormulaValidationTests < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_empty_formula_invalid
|
||||||
|
e = assert_raises(RuntimeError) { formula {} }
|
||||||
|
assert_equal "Formulae require at least a URL", e.message
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user