]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/config.t
config: assume lists have multiple addresses
[public-inbox.git] / t / config.t
index 040e9fb2dee6a8ab133bad648a88c8c938845026..437f1d145b868d35854ae54e2e3ef021590d2e79 100644 (file)
@@ -25,7 +25,7 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1);
        my $cfg = PublicInbox::Config->new($f);
        is_deeply($cfg->lookup('meta@public-inbox.org'), {
                'mainrepo' => '/home/pi/meta-main.git',
-               'address' => 'meta@public-inbox.org',
+               'address' => [ 'meta@public-inbox.org' ],
                'domain' => 'public-inbox.org',
                'url' => 'http://example.com/meta',
                -primary_address => 'meta@public-inbox.org',
@@ -78,6 +78,12 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1);
        my $cfg = PublicInbox::Config->new(\%tmp);
        my $ibx = $cfg->lookup_name('test');
        is($ibx->{nntpserver}, 'news.example.com', 'global NNTP server');
+
+       delete $h{'publicinbox.nntpserver'};
+       $h{"$pfx.nntpserver"} = 'news.alt.example.com';
+       $cfg = PublicInbox::Config->new(\%h);
+       $ibx = $cfg->lookup_name('test');
+       is($ibx->{nntpserver}, 'news.alt.example.com','per-inbox NNTP server');
 }
 
 done_testing();