aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorMisty De Meo2016-11-03 16:43:31 -0700
committerMisty De Meo2016-11-10 15:08:36 -0800
commitb6acb9cb47817631a69fba31a4cab2cae30da01b (patch)
tree07eab4129fddcb04da094fe72c729c1cec2a916b /Library/Homebrew/test
parentfbcf500a48bd8a6be2f009c35be5ae971e841b87 (diff)
downloadbrew-b6acb9cb47817631a69fba31a4cab2cae30da01b.tar.bz2
Version: allow comparing against nil
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_versions.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_versions.rb b/Library/Homebrew/test/test_versions.rb
index 6f85fe7a0..3e1c97b03 100644
--- a/Library/Homebrew/test/test_versions.rb
+++ b/Library/Homebrew/test/test_versions.rb
@@ -145,6 +145,10 @@ class VersionComparisonTests < Homebrew::TestCase
assert_operator version("2-p194"), :<, version("2.1-p195")
end
+ def test_comparing_against_nil
+ assert_operator version("2.1.0-p194"), :>, nil
+ end
+
def test_comparison_returns_nil_for_non_version
v = version("1.0")
assert_nil v <=> Object.new