tests/tc_standard_comparison.rb in versionomy-0.0.3 vs tests/tc_standard_comparison.rb in versionomy-0.0.4
- old
+ new
@@ -99,9 +99,30 @@
assert_not_equal(value2_, value1_)
assert_not_equal(value2_.hash, value1_.hash)
end
+ # Test equality with string.
+
+ def test_equality_string
+ value1_ = Versionomy.parse("1.8.7p72")
+ assert_operator(value1_, :==, "1.8.7p72")
+ assert_operator(value1_, :==, "1.8.7.0-72.0")
+ end
+
+
+ # Test comparison with string.
+
+ def test_comparison_string
+ value1_ = Versionomy.parse("1.8.7p72")
+ assert_operator(value1_, :<, "1.8.7p73")
+ assert_operator(value1_, :<, "1.8.8pre1")
+ assert_operator(value1_, :>, "1.8.7p71")
+ assert_operator(value1_, :>, "1.8.7rc2")
+ assert_operator(value1_, :>, "1.8.7.0")
+ end
+
+
end
end
end