]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/html_index.t
remove most internal Email::MIME usage
[public-inbox.git] / t / html_index.t
index f29b442d9f811b7b393322d5638f60a9c5c362b2..80f81577e2aee2d875a772678e26b665bc8ae877 100644 (file)
@@ -1,20 +1,20 @@
-# Copyright (C) 2014-2015 all contributors <meta@public-inbox.org>
-# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
+# Copyright (C) 2014-2020 all contributors <meta@public-inbox.org>
+# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use warnings;
 use Test::More;
-use Email::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Feed;
 use PublicInbox::Git;
 use PublicInbox::Import;
 use PublicInbox::Inbox;
-use File::Temp qw/tempdir/;
-my $tmpdir = tempdir('pi-http-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+use PublicInbox::TestCommon;
+my ($tmpdir, $for_destroy) = tmpdir();
 my $git_dir = "$tmpdir/gittest";
 my $ibx = PublicInbox::Inbox->new({
        address => 'test@example',
        name => 'tester',
-       mainrepo => $git_dir,
+       inboxdir => $git_dir,
        url => 'http://example.com/test',
 });
 my $git = $ibx->git;
@@ -22,7 +22,7 @@ my $im = PublicInbox::Import->new($git, 'tester', 'test@example');
 
 # setup
 {
-       is(0, system(qw(git init -q --bare), $git_dir), "git init");
+       $im->init_bare;
        my $prev = "";
 
        foreach my $i (1..6) {
@@ -32,7 +32,7 @@ my $im = PublicInbox::Import->new($git, 'tester', 'test@example');
                        $mid_line .= "In-Reply-To: $prev";
                }
                $prev = $mid;
-               my $mime = Email::MIME->new(<<EOF);
+               my $mime = PublicInbox::Eml->new(<<EOF);
 From: ME <me\@example.com>
 To: U <u\@example.com>
 $mid_line