Refactor formula_test.
This commit is contained in:
parent
6e7731aeff
commit
83fc432eab
@ -40,8 +40,13 @@ class FormulaNames <Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
class WellKnownCodeIssues <Test::Unit::TestCase
|
class WellKnownCodeIssues <Test::Unit::TestCase
|
||||||
|
def all_formulas
|
||||||
|
Dir["#{HOMEBREW_PREFIX}/Library/Formula/*.rb"].each {|f| yield f }
|
||||||
|
end
|
||||||
|
|
||||||
def test_for_commented_out_cmake
|
def test_for_commented_out_cmake
|
||||||
Dir["#{HOMEBREW_PREFIX}/Library/Formula/*.rb"].each do |f|
|
# Formulas shouldn't contain commented-out cmake code from the default template
|
||||||
|
all_formulas do |f|
|
||||||
result = `grep "# depends_on 'cmake'" "#{f}"`.strip
|
result = `grep "# depends_on 'cmake'" "#{f}"`.strip
|
||||||
assert_equal('', result, "Commented template code still in #{f}")
|
assert_equal('', result, "Commented template code still in #{f}")
|
||||||
end
|
end
|
||||||
@ -51,7 +56,7 @@ class WellKnownCodeIssues <Test::Unit::TestCase
|
|||||||
# Prefix should not have single quotes if the system args are already separated
|
# Prefix should not have single quotes if the system args are already separated
|
||||||
target_string = "[\\\"]--prefix=[\\']"
|
target_string = "[\\\"]--prefix=[\\']"
|
||||||
|
|
||||||
Dir["#{HOMEBREW_PREFIX}/Library/Formula/*.rb"].each do |f|
|
all_formulas do |f|
|
||||||
result = `grep -e "#{target_string}" "#{f}"`.strip
|
result = `grep -e "#{target_string}" "#{f}"`.strip
|
||||||
assert_equal('', result, "--prefix is incorrectly single-quoted in #{f}")
|
assert_equal('', result, "--prefix is incorrectly single-quoted in #{f}")
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user