X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fpsgi_scan_all.t;h=4d593941a38913d1f3692e19e90977ae94a38645;hb=95bdac7f09c69036efed537a4d03d5bdd2ae4eb6;hp=2e00b6d843160e43391f2d54b8dc5227f181b42f;hpb=356e1db5135802ed468719dfcd1f1c3f9dba9fff;p=public-inbox.git diff --git a/t/psgi_scan_all.t b/t/psgi_scan_all.t index 2e00b6d8..4d593941 100644 --- a/t/psgi_scan_all.t +++ b/t/psgi_scan_all.t @@ -1,30 +1,27 @@ -# 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::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_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 ($tmp, $for_destroy) = tmpdir(); my $cfg = ''; foreach my $i (1..2) { my $cfgpfx = "publicinbox.test-$i"; my $addr = "test-$i\@example.com"; - my $mainrepo = "$tmp/$i"; + my $inboxdir = "$tmp/$i"; $cfg .= "$cfgpfx.address=$addr\n"; - $cfg .= "$cfgpfx.mainrepo=$mainrepo\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',