brew/Library/Homebrew/test/test_formula_support.rb
Baptiste Fontaine ea08e4fb16 KegOnlyReason: print only the explanation if there’s one
Closes Homebrew/homebrew#42073.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-07-28 20:40:28 +02:00

14 lines
326 B
Ruby

require "testing_env"
class KegOnlyReasonTests < Homebrew::TestCase
def test_to_s_explanation
r = KegOnlyReason.new :provided_by_osx, "test"
assert_equal "test", r.to_s
end
def test_to_s_no_explanation
r = KegOnlyReason.new :provided_by_osx, ""
assert_match(/^OS X already provides/, r.to_s)
end
end