X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fpsgi_attach.t;h=2376bba7bf2f042e099588da5499429cd679193d;hb=e6b7a7f5f70fb89a54ff158bc6c8b564149947e5;hp=0c3174bc241c7c257567ea0905307c876316ae50;hpb=a09f678d8254064af7ca6dcfb3c3f84b5ae37b51;p=public-inbox.git
diff --git a/t/psgi_attach.t b/t/psgi_attach.t
index 0c3174bc..2376bba7 100644
--- a/t/psgi_attach.t
+++ b/t/psgi_attach.t
@@ -1,4 +1,4 @@
-# Copyright (C) 2016-2019 all contributors
+# Copyright (C) 2016-2020 all contributors
# License: AGPL-3.0+
use strict;
use warnings;
@@ -9,22 +9,21 @@ 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);
+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($maindir);
my $im = PublicInbox::Import->new($git, 'test', $addr);
+$im->init_bare;
{
open my $fh, '<', '/dev/urandom' or die "unable to open urandom: $!\n";
@@ -69,7 +68,7 @@ my $im = PublicInbox::Import->new($git, 'test', $addr);
);
$mime = $mime->as_string;
$mime =~ s/\r\n/\n/g; # normalize to LF only
- $mime = Email::MIME->new($mime);
+ $mime = PublicInbox::MIME->new($mime);
$im->add($mime);
$im->done;
@@ -108,7 +107,6 @@ my $im = PublicInbox::Import->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();