commit 6f682cd87a9155bed16e5568bec4056d7ba762fb
parent 0aeb6411352aa3c54b1d8e0277b035376f01bfa2
Author: William Morgan <wmorgan-sup@masanjin.net>
Date: Mon, 23 Mar 2009 10:11:16 -0400
update unit tests to reflect header parsing
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.
Diffstat:
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/test/test_mbox_parsing.rb b/test/test_mbox_parsing.rb
@@ -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