From: William Morgan Date: Mon, 23 Mar 2009 14:11:16 +0000 (-0400) Subject: update unit tests to reflect header parsing X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=6f682cd87a9155bed16e5568bec4056d7ba762fb;p=sup 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. --- 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