diff options
author | Eric Wong <e@80x24.org> | 2019-05-23 09:36:40 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-05-23 17:43:50 +0000 |
commit | 96a27a0a073b61c465240bbbbb05a4c16f67c8d4 (patch) | |
tree | 6ab703c46757f61782e5d135ebc5ef29826fc868 /t/nntpd.t | |
parent | 646c15c17c323aa80a9a25ca8755720926564ef8 (diff) | |
download | public-inbox-96a27a0a073b61c465240bbbbb05a4c16f67c8d4.tar.gz |
In retrospect, introducing V1Writable was unnecessary and InboxWritable->importer is in a better position to abstract away differences between v1 and v2 writers. So teach InboxWritable to initialize inboxes and get rid of V1Writable.
Diffstat (limited to 't/nntpd.t')
-rw-r--r-- | t/nntpd.t | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -9,6 +9,7 @@ foreach my $mod (qw(DBD::SQLite)) { } require PublicInbox::SearchIdx; require PublicInbox::Msgmap; +require PublicInbox::InboxWritable; use Email::Simple; use IO::Socket; use Socket qw(IPPROTO_TCP TCP_NODELAY); @@ -30,9 +31,6 @@ my $group = 'test-nntpd'; my $addr = $group . '@example.com'; my $nntpd = 'blib/script/public-inbox-nntpd'; my $init = 'blib/script/public-inbox-init'; -use_ok 'PublicInbox::Import'; -use_ok 'PublicInbox::Inbox'; -use_ok 'PublicInbox::Git'; SKIP: { skip "git 2.6+ required for V2Writable", 1 if $version == 1; use_ok 'PublicInbox::V2Writable'; @@ -68,15 +66,8 @@ $ibx = PublicInbox::Inbox->new($ibx); 0, 'enabled newsgroup'); my $len; - my $im; - if ($version == 2) { - $im = PublicInbox::V2Writable->new($ibx); - } elsif ($version == 1) { - use_ok 'PublicInbox::V1Writable'; - $im = PublicInbox::V1Writable->new($ibx); - } else { - die "unsupported version: $version"; - } + $ibx = PublicInbox::InboxWritable->new($ibx); + my $im = $ibx->importer; # ensure successful message delivery { |