diff options
author | Eric Wong <e@80x24.org> | 2023-09-24 05:42:14 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-09-24 18:56:18 +0000 |
commit | 21146412fdc32f8e6707b4e290ad715b35f20845 (patch) | |
tree | 53f4f32d1858ccae2ad8d24694da02cdc16ad9b4 /t/psgi_mount.t | |
parent | f170d220f8765e952c9a102dd35eb694810739df (diff) | |
download | public-inbox-21146412fdc32f8e6707b4e290ad715b35f20845.tar.gz |
It's a needless branch to maintain exclusively for our tests. The `git config -l' output isn't pleasant to write in tests, anyways. So just use heredocs to write git configs in their native format rather than emulate the output of `git config -l'. This does make the test suite do more work with temporary files and process invocations, but it doesn't seem very measurable when testing on tmpfs (TMPDIR=/dev/shm). We'll make a minor improvement to TestCommon::tmpdir by allowing it to return a single value (which I suspect we can rely on in more places since File::Temp::Dir overloads stringification).
Diffstat (limited to 't/psgi_mount.t')
-rw-r--r-- | t/psgi_mount.t | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/t/psgi_mount.t b/t/psgi_mount.t index 28689f11..e43b9f2d 100644 --- a/t/psgi_mount.t +++ b/t/psgi_mount.t @@ -1,14 +1,11 @@ #!perl -w -# Copyright (C) 2016-2021 all contributors <meta@public-inbox.org> +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> -use strict; -use v5.10.1; +use v5.12; use PublicInbox::Eml; use PublicInbox::TestCommon; -use PublicInbox::Config; my ($tmpdir, $for_destroy) = tmpdir(); my $v1dir = "$tmpdir/v1.git"; -my $cfgpfx = "publicinbox.test"; my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape Plack::Builder Plack::App::URLMap); require_mods(@mods); @@ -27,9 +24,10 @@ Date: Thu, 01 Jan 1970 00:00:00 +0000 zzzzzz EOF }; -my $cfg = PublicInbox::Config->new(\<<EOF); -$cfgpfx.address=$ibx->{-primary_address} -$cfgpfx.inboxdir=$v1dir +my $cfg = cfg_new $tmpdir, <<EOF; +[publicinbox "test"] + address = $ibx->{-primary_address} + inboxdir = $v1dir EOF my $www = PublicInbox::WWW->new($cfg); my $app = builder(sub { |