X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fpsgi_v2.t;h=8e81e89b4b71e4328268051c7a558e7b368aafd8;hb=3c313f9034aac96182e2efdc2f92c40803626f32;hp=e4f7306e1606b3f93abcb33471f5b817d65c72b7;hpb=1317fb7b4ace03f6d9dfb1a42ee5f9371a1bf913;p=public-inbox.git diff --git a/t/psgi_v2.t b/t/psgi_v2.t index e4f7306e..8e81e89b 100644 --- a/t/psgi_v2.t +++ b/t/psgi_v2.t @@ -3,9 +3,8 @@ use strict; use warnings; use Test::More; -require './t/common.perl'; +use PublicInbox::TestCommon; require_git(2.6); -use File::Temp qw/tempdir/; use PublicInbox::MIME; use PublicInbox::Config; use PublicInbox::WWW; @@ -18,9 +17,9 @@ foreach my $mod (@mods) { } use_ok($_) for @mods; use_ok 'PublicInbox::V2Writable'; -my $mainrepo = tempdir('pi-v2_dupes-XXXXXX', TMPDIR => 1, CLEANUP => 1); +my ($inboxdir, $for_destroy) = tmpdir(); my $ibx = { - mainrepo => $mainrepo, + inboxdir => $inboxdir, name => 'test-v2writable', version => 2, -primary_address => 'test@example.com', @@ -56,7 +55,7 @@ $im->done; my $cfgpfx = "publicinbox.v2test"; my $cfg = <{-primary_address} -$cfgpfx.mainrepo=$mainrepo +$cfgpfx.inboxdir=$inboxdir EOF my $config = PublicInbox::Config->new(\$cfg); my $www = PublicInbox::WWW->new($config); @@ -168,7 +167,7 @@ test_psgi(sub { $www->call(@_) }, sub { @from_ = ($raw =~ m/>From: /mg); is(scalar(@from_), 3, 'three From: lines'); foreach my $mid ('a-mid@b', $new_mid, $third) { - like($raw, qr/<\Q$mid\E>/s, "Message-ID $mid shown"); + like($raw, qr!>\Q$mid\E!s, "Message-ID $mid shown"); } like($raw, qr/\b3\+ messages\b/, 'thread overview shown');