aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorJack Nagel2012-08-04 00:26:59 -0500
committerJack Nagel2012-08-18 11:13:54 -0500
commit822aeac407fb92c8a6e61f48d786d3d3442ca731 (patch)
treebd3044da96d746ba48a82729da9ba2ca758dde32 /Library/Homebrew/test
parent610c65c908f8612e33fa5c6a6004d967ddad6baa (diff)
downloadhomebrew-822aeac407fb92c8a6e61f48d786d3d3442ca731.tar.bz2
Add custom comparator for MacOS.version
This will allow us to do comparisons like if MacOS.version >= :lion and hopefully deprecate the MacOS.<name>? family of methods, which are counterinitutive.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_versions.rb7
1 files changed, 7 insertions, 0 deletions
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