]> Sergey Matveev's repositories - public-inbox.git/blob - t/mime.t
introduce PublicInbox::MIME wrapper class
[public-inbox.git] / t / mime.t
1 # Copyright (C) 2017 all contributors <meta@public-inbox.org>
2 # This library is free software; you can redistribute it and/or modify
3 # it under the same terms as Perl itself.
4 # Artistic or GPL-1+ <https://www.gnu.org/licenses/gpl-1.0.txt>
5 use strict;
6 use warnings;
7 use Test::More;
8 use_ok 'PublicInbox::MIME';
9
10 my $msg = PublicInbox::MIME->new(
11 'From:   Richard Hansen <hansenr@google.com>
12 To:     git@vger.kernel.org
13 Cc:     Richard Hansen <hansenr@google.com>
14 Subject: [PATCH 0/2] minor diff orderfile documentation improvements
15 Date:   Mon,  9 Jan 2017 19:40:29 -0500
16 Message-Id: <20170110004031.57985-1-hansenr@google.com>
17 X-Mailer: git-send-email 2.11.0.390.gc69c2f50cf-goog
18 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256;
19         boundary="94eb2c0bc864b76ba30545b2bca9"
20
21 --94eb2c0bc864b76ba30545b2bca9
22
23 Richard Hansen (2):
24   diff: document behavior of relative diff.orderFile
25   diff: document the pattern format for diff.orderFile
26
27  Documentation/diff-config.txt  | 5 ++++-
28  Documentation/diff-options.txt | 3 ++-
29  2 files changed, 6 insertions(+), 2 deletions(-)
30
31
32 --94eb2c0bc864b76ba30545b2bca9
33 Content-Type: application/pkcs7-signature; name="smime.p7s"
34 Content-Transfer-Encoding: base64
35 Content-Disposition: attachment; filename="smime.p7s"
36 Content-Description: (truncated) S/MIME Cryptographic Signature
37
38 dkTlB69771K2eXK4LcHSH/2LqX+VYa3K44vrx1ruzjXdNWzIpKBy0weFNiwnJCGofvCysM2RCSI1
39 --94eb2c0bc864b76ba30545b2bca9--
40
41 ');
42
43 my @parts = $msg->parts;
44 my $exp = 'Richard Hansen (2):
45   diff: document behavior of relative diff.orderFile
46   diff: document the pattern format for diff.orderFile
47
48  Documentation/diff-config.txt  | 5 ++++-
49  Documentation/diff-options.txt | 3 ++-
50  2 files changed, 6 insertions(+), 2 deletions(-)
51
52 ';
53
54 ok($msg->isa('Email::MIME'), 'compatible with Email::MIME');
55 is($parts[0]->body, $exp, 'body matches expected');
56
57 done_testing();