diff options
Diffstat (limited to 't')
-rw-r--r-- | t/config.t | 19 | ||||
-rw-r--r-- | t/config_limiter.t | 9 |
2 files changed, 21 insertions, 7 deletions
@@ -31,7 +31,8 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1); -primary_address => 'meta@public-inbox.org', 'name' => 'meta', feedmax => 25, - -pi_config => $cfg, + -httpbackend_limiter => undef, + nntpserver => undef, }, "lookup matches expected output"); is($cfg->lookup('blah@example.com'), undef, @@ -48,7 +49,8 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1); 'name' => 'test', feedmax => 25, 'url' => 'http://example.com/test', - -pi_config => $cfg, + -httpbackend_limiter => undef, + nntpserver => undef, }, "lookup matches expected output for test"); } @@ -65,4 +67,17 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1); is_deeply($ibx->{altid}, [ @altid ]); } +{ + my $pfx = "publicinbox.test"; + my %h = ( + "$pfx.address" => 'test@example.com', + "$pfx.mainrepo" => '/path/to/non/existent', + "publicinbox.nntpserver" => 'news.example.com', + ); + my %tmp = %h; + my $cfg = PublicInbox::Config->new(\%tmp); + my $ibx = $cfg->lookup_name('test'); + is($ibx->{nntpserver}, 'news.example.com', 'global NNTP server'); +} + done_testing(); diff --git a/t/config_limiter.t b/t/config_limiter.t index 486bfbe9..f0b65281 100644 --- a/t/config_limiter.t +++ b/t/config_limiter.t @@ -37,12 +37,11 @@ my $cfgpfx = "publicinbox.test"; my $lim = $git->{-httpbackend_limiter}; ok($lim, 'Limiter exists'); is($lim->{max}, 3, 'limiter has expected slots'); - $git = undef; $ibx->{git} = undef; - PublicInbox::Inbox::weaken_task; - $git = $ibx->git; - isnt($old, "$git", 'got new Git object'); - is("$git->{-httpbackend_limiter}", "$lim", 'same limiter'); + PublicInbox::Inbox::cleanup_task; + my $new = $ibx->git; + isnt($old, "$new", 'got new Git object'); + is("$new->{-httpbackend_limiter}", "$lim", 'same limiter'); is($lim->{max}, 3, 'limiter has expected slots'); } |