X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fv2-add-remove-add.t;h=328f5326e36231fd8845b31e233061774d9d6763;hb=b3f81ce0c71d5d4eca347f259b5ae69660a2cb13;hp=1b700d760b92500d3837695bfe61a39da4659274;hpb=b0e5062d43a96372801713ef78a78d6a1bc852bc;p=public-inbox.git
diff --git a/t/v2-add-remove-add.t b/t/v2-add-remove-add.t
index 1b700d76..328f5326 100644
--- a/t/v2-add-remove-add.t
+++ b/t/v2-add-remove-add.t
@@ -1,21 +1,16 @@
-# Copyright (C) 2018 all contributors
+# Copyright (C) 2018-2020 all contributors
# License: AGPL-3.0+
use strict;
use warnings;
use Test::More;
use PublicInbox::MIME;
-use File::Temp qw/tempdir/;
-require './t/common.perl';
+use PublicInbox::TestCommon;
require_git(2.6);
-
-foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
- eval "require $mod";
- plan skip_all => "$mod missing for v2-add-remove-add.t" if $@;
-}
+require_mods(qw(DBD::SQLite Search::Xapian));
use_ok 'PublicInbox::V2Writable';
-my $mainrepo = tempdir('pi-add-remove-add-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my ($inboxdir, $for_destroy) = tmpdir();
my $ibx = {
- mainrepo => "$mainrepo/v2",
+ inboxdir => "$inboxdir/v2",
name => 'test-v2writable',
version => 2,
-primary_address => 'test@example.com',
@@ -34,7 +29,7 @@ my $mime = PublicInbox::MIME->create(
my $im = PublicInbox::V2Writable->new($ibx, 1);
$im->{parallel} = 0;
ok($im->add($mime), 'message added');
-ok($im->remove($mime), 'message added');
+ok($im->remove($mime), 'message removed');
ok($im->add($mime), 'message added again');
$im->done;
my $msgs = $ibx->recent({limit => 1000});