brew/Library/Homebrew/test/test_formula_support.rb
Mike McQuaid 3f9cce0a03 Use new "macOS" naming where appropriate.
Not quite a mass replacement as I've used OS X and Mac OS X where
describing specific older versions and added compatibility methods
for things in the DSL.
2016-09-18 19:57:19 +01:00

29 lines
868 B
Ruby

require "testing_env"
require "formula_support"
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_macos, ""
assert_match(/^macOS already provides/, r.to_s)
end
end
class BottleDisableReasonTests < Homebrew::TestCase
def test_bottle_unneeded
bottle_disable_reason = BottleDisableReason.new :unneeded, nil
assert_predicate bottle_disable_reason, :unneeded?
assert_equal "This formula doesn't require compiling.", bottle_disable_reason.to_s
end
def test_bottle_disabled
bottle_disable_reason = BottleDisableReason.new :disable, "reason"
refute_predicate bottle_disable_reason, :unneeded?
assert_equal "reason", bottle_disable_reason.to_s
end
end