]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/plack.t
tests: move giant inbox/git dependent tests to xt/
[public-inbox.git] / t / plack.t
index 2ff98e983e34527113b51a852e73aafe5c568ca8..6023a419d0716ad169a670ee1451f9d1fbd33acb 100644 (file)
--- a/t/plack.t
+++ b/t/plack.t
@@ -1,12 +1,12 @@
-# Copyright (C) 2014-2018 all contributors <meta@public-inbox.org>
+# Copyright (C) 2014-2019 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use warnings;
 use Test::More;
 use Email::MIME;
-use File::Temp qw/tempdir/;
+require './t/common.perl';
 my $psgi = "./examples/public-inbox.psgi";
-my $tmpdir = tempdir('pi-plack-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my ($tmpdir, $for_destroy) = tmpdir();
 my $pi_config = "$tmpdir/config";
 my $maindir = "$tmpdir/main.git";
 my $addr = 'test-public@example.com';
@@ -29,7 +29,7 @@ foreach my $mod (@mods) { use_ok $mod; }
        close $fh or die "close: $!\n";
        my %cfg = (
                "$cfgpfx.address" => $addr,
-               "$cfgpfx.mainrepo" => $maindir,
+               "$cfgpfx.inboxdir" => $maindir,
                "$cfgpfx.url" => 'http://example.com/test/',
                "$cfgpfx.newsgroup" => 'inbox.test',
        );
@@ -54,9 +54,9 @@ EOF
                my $im = PublicInbox::Import->new($git, 'test', $addr);
                $im->add($mime);
                $im->done;
-               my $rev = `git --git-dir="$maindir" rev-list HEAD`;
+               my $rev = $git->qx(qw(rev-list HEAD));
                like($rev, qr/\A[a-f0-9]{40}/, "good revision committed");
-               @ls = `git --git-dir="$maindir" ls-tree -r --name-only HEAD`;
+               @ls = $git->qx(qw(ls-tree -r --name-only HEAD));
                chomp @ls;
        }
        my $app = eval {