X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fhtml_index.t;h=80f81577e2aee2d875a772678e26b665bc8ae877;hb=de9648ca847cf032aab6da9cac1217bf9cca9c90;hp=32d7b8de4383c01226f43c18c6695f5f522ebd2a;hpb=4b313dc74bc9bb84a542b7ec920cdb92879e7523;p=public-inbox.git
diff --git a/t/html_index.t b/t/html_index.t
index 32d7b8de..80f81577 100644
--- a/t/html_index.t
+++ b/t/html_index.t
@@ -1,21 +1,20 @@
-# Copyright (C) 2014-2015 all contributors
-# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
+# Copyright (C) 2014-2020 all contributors
+# License: AGPL-3.0+
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',
- -primary_address => 'test@example',
name => 'tester',
- mainrepo => $git_dir,
+ inboxdir => $git_dir,
url => 'http://example.com/test',
});
my $git = $ibx->git;
@@ -23,22 +22,17 @@ 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) {
- # my $pid = open(my $pipe, "|-");
- # defined $pid or die "fork/pipe failed: $!\n";
- # if ($pid == 0) {
- # exec("ssoma-mda", $git_dir);
- # }
my $mid = "<$i\@example.com>";
my $mid_line = "Message-ID: $mid";
if ($prev) {
$mid_line .= "In-Reply-To: $prev";
}
$prev = $mid;
- my $mime = Email::MIME->new(<new(<
To: U
$mid_line
@@ -59,15 +53,4 @@ EOF
$im->done;
}
-# check HTML index
-{
- use IO::File;
- my $cb = PublicInbox::Feed::generate_html_index({
- -inbox => $ibx,
- max => 3
- });
- require 't/common.perl';
- like(stream_to_string($cb), qr/html/, "feed is valid HTML :)");
-}
-
done_testing();