-# Copyright (C) 2018 all contributors <meta@public-inbox.org>
+# Copyright (C) 2018-2019 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 File::Temp qw/tempdir/;
use PublicInbox::MIME;
use PublicInbox::Config;
use PublicInbox::WWW;
+require './t/common.perl';
my @mods = qw(DBD::SQLite HTTP::Request::Common Plack::Test
URI::Escape Plack::Builder);
foreach my $mod (@mods) {
}
use_ok($_) for @mods;
use_ok 'PublicInbox::V2Writable';
-my $mainrepo = tempdir('pi-bad-mids-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my ($inboxdir, $for_destroy) = tmpdir();
my $cfgpfx = "publicinbox.bad-mids";
my $ibx = {
- mainrepo => $mainrepo,
+ inboxdir => $inboxdir,
name => 'bad-mids',
version => 2,
-primary_address => 'test@example.com',
}
$im->done;
-my $cfg = {
- "$cfgpfx.address" => $ibx->{-primary_address},
- "$cfgpfx.mainrepo" => $mainrepo,
-};
-my $config = PublicInbox::Config->new($cfg);
+my $cfg = <<EOF;
+$cfgpfx.address=$ibx->{-primary_address}
+$cfgpfx.inboxdir=$inboxdir
+EOF
+my $config = PublicInbox::Config->new(\$cfg);
my $www = PublicInbox::WWW->new($config);
test_psgi(sub { $www->call(@_) }, sub {
my ($cb) = @_;