From b8231fc5f3e93f2d7a230e7880fb2fdc7c04c369 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 4 Aug 2012 00:26:59 -0500 Subject: Add custom comparator for MacOS.version This will allow us to do comparisons like if MacOS.version >= :lion and hopefully deprecate the MacOS.? family of methods, which are counterinitutive. --- Library/Homebrew/test/test_versions.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Library/Homebrew/test') diff --git a/Library/Homebrew/test/test_versions.rb b/Library/Homebrew/test/test_versions.rb index ab6f83991..972ce130b 100644 --- a/Library/Homebrew/test/test_versions.rb +++ b/Library/Homebrew/test/test_versions.rb @@ -24,6 +24,13 @@ class VersionComparisonTests < Test::Unit::TestCase assert_version_comparison 'HEAD', '>', '1.2.3' assert_version_comparison '1.2.3', '<', 'HEAD' end + + def test_macos_version_comparison + v = MacOSVersion.new(10.6) + assert v == 10.6 + assert v == :snow_leopard + assert v < :lion + end end class VersionParsingTests < Test::Unit::TestCase -- cgit v1.2.3