X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fpsgi_scan_all.t;h=c8cb2409985e944adef2e292e78ad03b6e68247d;hb=352956bcf1933bdaeba631deb4ade7dc7fd754b1;hp=2f54c8207578303bcc92f06facf880d19a388c4d;hpb=e220b8b2ee5cfd458167dc2c6c92726352c4c80e;p=public-inbox.git
diff --git a/t/psgi_scan_all.t b/t/psgi_scan_all.t
index 2f54c820..c8cb2409 100644
--- a/t/psgi_scan_all.t
+++ b/t/psgi_scan_all.t
@@ -1,28 +1,28 @@
-# Copyright (C) 2019 all contributors
+# Copyright (C) 2019-2020 all contributors
# License: AGPL-3.0+
use strict;
use warnings;
use Test::More;
-use Email::MIME;
-use File::Temp qw/tempdir/;
+use PublicInbox::Eml;
use PublicInbox::Config;
+use PublicInbox::TestCommon;
my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape DBD::SQLite);
-foreach my $mod (@mods) {
- eval "require $mod";
- plan skip_all => "$mod missing for psgi_scan_all.t" if $@;
-}
+require_git 2.6;
+require_mods(@mods);
use_ok 'PublicInbox::V2Writable';
foreach my $mod (@mods) { use_ok $mod; }
-my $tmp = tempdir('pi-scan_all-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-my $cfg = {};
+my ($tmp, $for_destroy) = tmpdir();
+my $cfg = '';
foreach my $i (1..2) {
my $cfgpfx = "publicinbox.test-$i";
- my $addr = $cfg->{"$cfgpfx.address"} = "test-$i\@example.com";
- my $mainrepo = $cfg->{"$cfgpfx.mainrepo"} = "$tmp/$i";
- $cfg->{"$cfgpfx.url"} = "http://example.com/$i";
+ my $addr = "test-$i\@example.com";
+ my $inboxdir = "$tmp/$i";
+ $cfg .= "$cfgpfx.address=$addr\n";
+ $cfg .= "$cfgpfx.inboxdir=$inboxdir\n";
+ $cfg .= "$cfgpfx.url=http://example.com/$i\n";
my $opt = {
- mainrepo => $mainrepo,
+ inboxdir => $inboxdir,
name => "test-$i",
version => 2,
indexlevel => 'basic',
@@ -32,7 +32,7 @@ foreach my $i (1..2) {
my $im = PublicInbox::V2Writable->new($ibx, 1);
$im->{parallel} = 0;
$im->init_inbox(0);
- my $mime = PublicInbox::MIME->new(<new(<add($mime), "added message to $i");
$im->done;
}
-my $config = PublicInbox::Config->new($cfg);
+my $config = PublicInbox::Config->new(\$cfg);
use_ok 'PublicInbox::WWW';
my $www = PublicInbox::WWW->new($config);