about summary refs log tree commit homepage
path: root/t/psgi_scan_all.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-15 00:38:06 +0000
committerEric Wong <e@80x24.org>2019-10-15 20:26:41 +0000
commit1317fb7b4ace03f6d9dfb1a42ee5f9371a1bf913 (patch)
treef46b2e82a2edd849b3ded014bb4b209e778e6a2f /t/psgi_scan_all.t
parent53a8e32b97985803e9de12c4312a86a8850208b3 (diff)
downloadpublic-inbox-1317fb7b4ace03f6d9dfb1a42ee5f9371a1bf913.tar.gz
Rewrite a bunch of tests to use ordered input (emulating
"git config -l" output) so we can always walk sections in
the order they were given in the config file.
Diffstat (limited to 't/psgi_scan_all.t')
-rw-r--r--t/psgi_scan_all.t12
1 files changed, 7 insertions, 5 deletions
diff --git a/t/psgi_scan_all.t b/t/psgi_scan_all.t
index 2f54c820..2e00b6d8 100644
--- a/t/psgi_scan_all.t
+++ b/t/psgi_scan_all.t
@@ -14,13 +14,15 @@ foreach my $mod (@mods) {
 use_ok 'PublicInbox::V2Writable';
 foreach my $mod (@mods) { use_ok $mod; }
 my $tmp = tempdir('pi-scan_all-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-my $cfg = {};
+my $cfg = '';
 
 foreach my $i (1..2) {
         my $cfgpfx = "publicinbox.test-$i";
-        my $addr = $cfg->{"$cfgpfx.address"} = "test-$i\@example.com";
-        my $mainrepo = $cfg->{"$cfgpfx.mainrepo"} = "$tmp/$i";
-        $cfg->{"$cfgpfx.url"} = "http://example.com/$i";
+        my $addr = "test-$i\@example.com";
+        my $mainrepo = "$tmp/$i";
+        $cfg .= "$cfgpfx.address=$addr\n";
+        $cfg .= "$cfgpfx.mainrepo=$mainrepo\n";
+        $cfg .= "$cfgpfx.url=http://example.com/$i\n";
         my $opt = {
                 mainrepo => $mainrepo,
                 name => "test-$i",
@@ -45,7 +47,7 @@ EOF
         ok($im->add($mime), "added message to $i");
         $im->done;
 }
-my $config = PublicInbox::Config->new($cfg);
+my $config = PublicInbox::Config->new(\$cfg);
 use_ok 'PublicInbox::WWW';
 my $www = PublicInbox::WWW->new($config);