]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/httpd-unix.t
testcommon: add require_mods method and use it
[public-inbox.git] / t / httpd-unix.t
index 2c8f8d6b2a6b0457a02cd0e83e7188b7faa5c6a5..6da2ac6be54455ea04de89a5c8e82fe2ad2b0a8c 100644 (file)
@@ -4,14 +4,9 @@
 use strict;
 use warnings;
 use Test::More;
-require './t/common.perl';
+use PublicInbox::TestCommon;
 use Errno qw(EADDRINUSE);
-
-foreach my $mod (qw(Plack::Util Plack::Builder HTTP::Date HTTP::Status)) {
-       eval "require $mod";
-       plan skip_all => "$mod missing for httpd-unix.t" if $@;
-}
-
+require_mods(qw(Plack::Util Plack::Builder HTTP::Date HTTP::Status));
 use IO::Socket::UNIX;
 my ($tmpdir, $for_destroy) = tmpdir();
 my $unix = "$tmpdir/unix.sock";
@@ -85,8 +80,7 @@ check_sock($unix);
 }
 
 SKIP: {
-       eval 'require Net::Server::Daemonize';
-       skip('Net::Server missing for pid-file/daemonization test', 20) if $@;
+       require_mods('Net::Server::Daemonize', 20);
        my $pid_file = "$tmpdir/pid";
        for my $w (qw(-W0 -W1)) {
                # wait for daemonization