]> git.cworth.org Git - sup/commitdiff
update unit tests to reflect header parsing
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Mon, 23 Mar 2009 14:11:16 +0000 (10:11 -0400)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Mon, 23 Mar 2009 14:11:16 +0000 (10:11 -0400)
Blank headers now have a value of "", not nil. Nothing wrong with that.
The test captures behavior that doesn't really matter, but I've updated
it to at least reflect reality.

test/test_mbox_parsing.rb

index 3a6c2f854d4c00600f97aa608b3061e22d29d8ab..32687e5f1559ee340ff572ca6e79b801deb19140 100644 (file)
@@ -74,15 +74,19 @@ EOS
     end
   end
 
-  def test_ignore_empty_lines
+  def test_blank_lines
+    h = MBox.read_header StringIO.new("")
+    assert_equal nil, h["Message-Id"]
+  end
+
+  def test_empty_headers
     variants = [
-      "",
       "Message-Id:       \n",
       "Message-Id:\n",
     ]
     variants.each do |s|
       h = MBox.read_header StringIO.new(s)
-      assert_nil h["Message-Id"]
+      assert_equal "", h["Message-Id"]
     end
   end