X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fpsgi_attach.t;h=297e92e1a4fb2107affc425dedf667cbc7fef9c3;hb=6ebcec3add4d6aeff6e3b3eb019a404528c079ec;hp=45f05bacd404f2017921017f80c31b07a828d3c1;hpb=ad6f26f3b9f0e428020d05667987556f8fcbec2f;p=public-inbox.git diff --git a/t/psgi_attach.t b/t/psgi_attach.t index 45f05bac..297e92e1 100644 --- a/t/psgi_attach.t +++ b/t/psgi_attach.t @@ -1,26 +1,22 @@ -# Copyright (C) 2016-2019 all contributors +# Copyright (C) 2016-2020 all contributors # License: AGPL-3.0+ use strict; use warnings; use Test::More; use Email::MIME; -require './t/common.perl'; +use PublicInbox::TestCommon; my ($tmpdir, $for_destroy) = tmpdir(); my $maindir = "$tmpdir/main.git"; my $addr = 'test-public@example.com'; my $cfgpfx = "publicinbox.test"; -my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape); -foreach my $mod (@mods) { - eval "require $mod"; - plan skip_all => "$mod missing for plack.t" if $@; -} +my @mods = qw(HTTP::Request::Common Plack::Builder Plack::Test URI::Escape); +require_mods(@mods); use_ok $_ foreach @mods; +use_ok 'PublicInbox::WWW'; use PublicInbox::Import; use PublicInbox::Git; use PublicInbox::Config; -use PublicInbox::WWW; use_ok 'PublicInbox::WwwAttach'; -use Plack::Builder; my $config = PublicInbox::Config->new(\<new($git, 'test', $addr); ok(length($dot_res) >= length($dot), 'dot almost matches'); $res = $cb->(GET('/test/Z%40B/4-any-filename.txt')); is($res->content, $dot_res, 'user-specified filename is OK'); - }); } done_testing();