]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/plack.t
website: re-add top-level files
[public-inbox.git] / t / plack.t
index 6023a419d0716ad169a670ee1451f9d1fbd33acb..ec45b02cc7297ec213ea44fbe8a0d58f00b928fd 100644 (file)
--- a/t/plack.t
+++ b/t/plack.t
@@ -4,18 +4,14 @@ use strict;
 use warnings;
 use Test::More;
 use Email::MIME;
-require './t/common.perl';
+use PublicInbox::TestCommon;
 my $psgi = "./examples/public-inbox.psgi";
 my ($tmpdir, $for_destroy) = tmpdir();
 my $pi_config = "$tmpdir/config";
 my $maindir = "$tmpdir/main.git";
 my $addr = 'test-public@example.com';
-my $cfgpfx = "publicinbox.test";
 my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape);
-foreach my $mod (@mods) {
-       eval "require $mod";
-       plan skip_all => "$mod missing for plack.t" if $@;
-}
+require_mods(@mods);
 use_ok 'PublicInbox::Import';
 use_ok 'PublicInbox::Git';
 my @ls;
@@ -27,16 +23,15 @@ foreach my $mod (@mods) { use_ok $mod; }
        open my $fh, '>', "$maindir/description" or die "open: $!\n";
        print $fh "test for public-inbox\n";
        close $fh or die "close: $!\n";
-       my %cfg = (
-               "$cfgpfx.address" => $addr,
-               "$cfgpfx.inboxdir" => $maindir,
-               "$cfgpfx.url" => 'http://example.com/test/',
-               "$cfgpfx.newsgroup" => 'inbox.test',
-       );
-       while (my ($k,$v) = each %cfg) {
-               is(0, system(qw(git config --file), $pi_config, $k, $v),
-                       "setup $k");
-       }
+       open $fh, '>>', $pi_config or die;
+       print $fh <<EOF or die;
+[publicinbox "test"]
+       address = $addr
+       inboxdir = $maindir
+       url = http://example.com/test/
+       newsgroup = inbox.test
+EOF
+       close $fh or die;
 
        # ensure successful message delivery
        {