sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit a3b77fd720963dbdaf99c7b5611c64c6f49ad665
parent bcbeb98b32118d1c36cb465fa67b5eb153c127ff
Author: Iain Parris <ipv2.vcs@parris.org>
Date:   Sun, 19 Jul 2020 13:23:34 +0100

tests: assert embedded message's Date header

The raw header is converted to the local timezone, so we assert both
parts of the Date header: the literal string "Date: ", followed by an
RFC 2822 compliant timestamp representing the same moment.

Diffstat:
M test/test_message.rb | 5 +++++
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/test/test_message.rb b/test/test_message.rb
@@ -296,6 +296,11 @@ class TestMessage < Minitest::Test
     assert_equal(4, chunks[1].lines.length)
     assert_equal("From: Embed sender <embed@example.com>", chunks[1].lines[0])
     assert_equal("To: rcpt2 <rcpt2@example.invalid>", chunks[1].lines[1])
+    assert_equal("Date: ", chunks[1].lines[2][0..5])
+    assert_equal(
+      Time.rfc2822("Wed, 15 Jul 2020 12:34:56 +0000"),
+      Time.rfc2822(chunks[1].lines[2][6..-1])
+    )
     assert_equal("Subject: Embedded subject line", chunks[1].lines[3])
 
     assert(chunks[2].is_a? Redwood::Chunk::Text)