From 6f682cd87a9155bed16e5568bec4056d7ba762fb Mon Sep 17 00:00:00 2001 From: William Morgan Date: Mon, 23 Mar 2009 10:11:16 -0400 Subject: [PATCH] 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. --- test/test_mbox_parsing.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/test_mbox_parsing.rb b/test/test_mbox_parsing.rb index 3a6c2f8..32687e5 100644 --- 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 -- 2.43.0