test/vcard_test.rb in vcard-0.2.0 vs test/vcard_test.rb in vcard-0.2.1
- old
+ new
@@ -377,12 +377,10 @@
end
def test_bday_decode
card = Vcard::Vcard.decode(vcard(:bday_decode)).first
- card.birthday
-
assert_equal(Date.new(1970, 7, 14), card.birthday)
assert_equal(1, card.values("bday").size)
# Nobody should have multiple bdays, I hope, but its allowed syntactically,
# so test it, along with some variant forms of BDAY
@@ -396,10 +394,16 @@
assert_equal(Date.new(Time.now.year, 7, 14), card.values("bday")[1])
assert_equal(DateTime.new(1970, 7, 15, 3, 45, 12).to_s, card.values("bday")[2].to_s)
assert_equal(DateTime.new(1970, 7, 15, 3, 45, 12).to_s, card.values("bday").last.to_s)
end
+ def test_bday_decode_3
+ card = Vcard::Vcard.decode(vcard(:bday_decode_3)).first
+
+ assert_equal(Date.new(1980, 10, 25), card.birthday)
+ end
+
def test_utf_heuristics
bom = "\xEF\xBB\xBF"
dat = "BEGIN:VCARD\nN:name\nEND:VCARD\n"
utf_name_test(bom+dat)
utf_name_test(bom+dat.downcase)
@@ -472,6 +476,5 @@
def test_org_multiple
_test_org("Megamix Corp.", "Marketing")
end
end
-