]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/httpd.t
testcommon: add require_mods method and use it
[public-inbox.git] / t / httpd.t
index ce8063b28672863fa97fa73f52b9f8b1d3f3d75e..880c69e62f601d9d54b48bd7624e6ff98f898f83 100644 (file)
--- a/t/httpd.t
+++ b/t/httpd.t
@@ -3,17 +3,12 @@
 use strict;
 use warnings;
 use Test::More;
-
-foreach my $mod (qw(Plack::Util Plack::Builder HTTP::Date HTTP::Status)) {
-       eval "require $mod";
-       plan skip_all => "$mod missing for httpd.t" if $@;
-}
-use File::Temp qw/tempdir/;
+use PublicInbox::TestCommon;
 use Socket qw(IPPROTO_TCP SOL_SOCKET);
-require './t/common.perl';
+require_mods(qw(Plack::Util Plack::Builder HTTP::Date HTTP::Status));
 
 # FIXME: too much setup
-my $tmpdir = tempdir('pi-httpd-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my ($tmpdir, $for_destroy) = tmpdir();
 my $home = "$tmpdir/pi-home";
 my $err = "$tmpdir/stderr.log";
 my $out = "$tmpdir/stdout.log";