tests/tc_standard_comparison.rb in versionomy-0.0.2 vs tests/tc_standard_comparison.rb in versionomy-0.0.3

- old
+ new

@@ -69,9 +69,39 @@ value2_ = Versionomy.create(:major => 2, :release_type => :release_candidate, :release_candidate_version => 2) assert(value2_ > value1_) end + # Test equality for a simple case. + + def test_equality_simple + value1_ = Versionomy.create(:major => 2, :minor => 0, :release_type => :alpha, :alpha_version => 5) + value2_ = Versionomy.create(:major => 2, :release_type => :alpha, :alpha_version => 5) + assert_equal(value2_, value1_) + assert_equal(value2_.hash, value1_.hash) + end + + + # Test equality from parsed values. + + def test_equality_parsed + value1_ = Versionomy.parse("1.8.7p72") + value2_ = Versionomy.parse("1.8.7.0-72.0") + assert_equal(value2_, value1_) + assert_equal(value2_.hash, value1_.hash) + end + + + # Test non-equality from parsed values. + + def test_nonequality_parsed + value1_ = Versionomy.parse("1.8.7b7") + value2_ = Versionomy.parse("1.8.7a7") + assert_not_equal(value2_, value1_) + assert_not_equal(value2_.hash, value1_.hash) + end + + end end end