diff options
Diffstat (limited to 't/psgi_scan_all.t')
-rw-r--r-- | t/psgi_scan_all.t | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/t/psgi_scan_all.t b/t/psgi_scan_all.t index 09e8eaf9..4c28b553 100644 --- a/t/psgi_scan_all.t +++ b/t/psgi_scan_all.t @@ -1,17 +1,15 @@ #!perl -w -# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org> +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> -use strict; -use v5.10.1; +use v5.12; use PublicInbox::TestCommon; use PublicInbox::Eml; -use PublicInbox::Config; -my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape DBD::SQLite); -require_git 2.6; -require_mods(@mods); -use_ok 'PublicInbox::WWW'; -foreach my $mod (@mods) { use_ok $mod; } -my $cfg = ''; +my @use = qw(HTTP::Request::Common Plack::Test); +my @req = qw(URI::Escape DBD::SQLite); +require_git v2.6; +require_mods(@use, @req, qw(PublicInbox::WWW)); +$_->import for @use; +my $cfgtxt = ''; foreach my $i (1..2) { my $ibx = create_inbox "test-$i", version => 2, indexlevel => 'basic', sub { @@ -26,13 +24,15 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000 hello world EOF }; - my $cfgpfx = "publicinbox.test-$i"; - $cfg .= "$cfgpfx.address=$ibx->{-primary_address}\n"; - $cfg .= "$cfgpfx.inboxdir=$ibx->{inboxdir}\n"; - $cfg .= "$cfgpfx.url=http://example.com/$i\n"; - + $cfgtxt .= <<EOM; +[publicinbox "test-$i"] + address = $ibx->{-primary_address} + inboxdir = $ibx->{inboxdir} + url = http://example.com/$i +EOM } -my $www = PublicInbox::WWW->new(PublicInbox::Config->new(\$cfg)); +my $tmpdir = tmpdir; +my $www = PublicInbox::WWW->new(cfg_new($tmpdir, $cfgtxt)); test_psgi(sub { $www->call(@_) }, sub { my ($cb) = @_; |