X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fpurge.t;h=2ca9edca73cbfda0f0d51e19b24f696728cef44e;hb=0283273a14e1871955f6a9132f4f3f7884ec8a3f;hp=bcdbad52b751fa7ccf5caf2b3d27bc5c0cc26122;hpb=204626589e05d0288cdf232daffc511b01c63576;p=public-inbox.git diff --git a/t/purge.t b/t/purge.t index bcdbad52..2ca9edca 100644 --- a/t/purge.t +++ b/t/purge.t @@ -1,19 +1,15 @@ -# Copyright (C) 2019 all contributors +# Copyright (C) 2019-2020 all contributors # License: AGPL-3.0+ use strict; use warnings; use Test::More; -use File::Temp qw/tempdir/; -require './t/common.perl'; +use PublicInbox::TestCommon; require_git(2.6); -my @mods = qw(DBI DBD::SQLite); -foreach my $mod (@mods) { - eval "require $mod"; - plan skip_all => "missing $mod for t/purge.t" if $@; -}; +require_mods(qw(DBD::SQLite)); use Cwd qw(abs_path); # we need this since we chdir below +local $ENV{HOME} = abs_path('t'); my $purge = abs_path('blib/script/public-inbox-purge'); -my $tmpdir = tempdir('pi-purge-XXXXXX', TMPDIR => 1, CLEANUP => 1); +my ($tmpdir, $for_destroy) = tmpdir(); use_ok 'PublicInbox::V2Writable'; my $inboxdir = "$tmpdir/v2"; my $ibx = PublicInbox::Inbox->new({ @@ -40,7 +36,7 @@ local $ENV{PI_CONFIG} = $cfgfile; open my $cfg_fh, '>', $cfgfile or die "open: $!"; my $v2w = PublicInbox::V2Writable->new($ibx, {nproc => 1}); -my $mime = PublicInbox::MIME->new($raw); +my $mime = PublicInbox::Eml->new($raw); ok($v2w->add($mime), 'add message to be purged'); $v2w->done;