]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/psgi_v2.t
testcommon: introduce mime_load sub
[public-inbox.git] / t / psgi_v2.t
index bc26a1129364b0543c1e2995c170405a36d53755..5d212ca6f7ca1bb126bef8f92d02123f01789891 100644 (file)
@@ -225,6 +225,7 @@ test_psgi(sub { $www->call(@_) }, sub {
 
        # ensure conflicted attachments can be resolved
        foreach my $body (qw(old new)) {
+               $mime = mime_load "t/psgi_v2-$body.eml", sub {
                my $parts = [
                        Email::MIME->create(
                                attributes => { content_type => 'text/plain' },
@@ -238,12 +239,12 @@ test_psgi(sub { $www->call(@_) }, sub {
                                body => $body
                        )
                ];
-               $mime = Email::MIME->create(
+               Email::MIME->create(
                        parts => $parts,
                        header_str => [ From => 'root@z',
                                'Message-ID' => '<a@dup>',
                                Subject => 'hi']
-               );
+               )}; # mime_load sub
                ok($im->add($mime), "added attachment $body");
        }
        $im->done;