]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/nntp.t
nntp: NEWGROUPS uses long_response
[public-inbox.git] / t / nntp.t
index 1db896cf46b5a6376929e8de6c501e28d8d0d6f0..ea2ef8763114cd79cc184380fa9d95ff3a30d4b4 100644 (file)
--- a/t/nntp.t
+++ b/t/nntp.t
@@ -8,6 +8,7 @@ use PublicInbox::Eml;
 require_mods(qw(DBD::SQLite Data::Dumper));
 use_ok 'PublicInbox::NNTP';
 use_ok 'PublicInbox::Inbox';
+use PublicInbox::Config;
 
 {
        sub quote_str {
@@ -110,11 +111,14 @@ use_ok 'PublicInbox::Inbox';
        my $mime = PublicInbox::Eml->new("Message-ID: <$mid>\r\n\r\n");
        my $hdr = $mime->header_obj;
        my $mock_self = {
-               nntpd => { grouplist => [], servername => 'example.com' },
+               nntpd => {
+                       servername => 'example.com',
+                       pi_config => bless {}, 'PublicInbox::Config',
+               },
                ng => $ng,
        };
-       my $smsg = { num => 1, mid => $mid };
-       PublicInbox::NNTP::set_nntp_headers($mock_self, $hdr, $smsg);
+       my $smsg = { num => 1, mid => $mid, nntp => $mock_self, -ibx => $ng };
+       PublicInbox::NNTP::set_nntp_headers($hdr, $smsg);
        is_deeply([ $mime->header('Message-ID') ], [ "<$mid>" ],
                'Message-ID unchanged');
        is_deeply([ $mime->header('Archived-At') ], [ "<${u}a\@b/>" ],
@@ -130,7 +134,7 @@ use_ok 'PublicInbox::Inbox';
 
        $ng->{-base_url} = 'http://mirror.example.com/m/';
        $smsg->{num} = 2;
-       PublicInbox::NNTP::set_nntp_headers($mock_self, $hdr, $smsg);
+       PublicInbox::NNTP::set_nntp_headers($hdr, $smsg);
        is_deeply([ $mime->header('Message-ID') ], [ "<$mid>" ],
                'Message-ID unchanged');
        is_deeply([ $mime->header('Archived-At') ],