use Test::More;
use Email::MIME;
use PublicInbox::Feed;
-use PublicInbox::Git;
use PublicInbox::Import;
-use PublicInbox::Config;
use PublicInbox::Inbox;
-use File::Temp qw/tempdir/;
my $have_xml_feed = eval { require XML::Feed; 1 };
-require './t/common.perl';
+use PublicInbox::TestCommon;
sub string_feed {
- stream_to_string(PublicInbox::Feed::generate($_[0]));
+ my $res = PublicInbox::Feed::generate($_[0]);
+ my $body = $res->[2];
+ my $str = '';
+ while (defined(my $chunk = $body->getline)) {
+ $str .= $chunk;
+ }
+ $body->close;
+ $str;
}
-my $tmpdir = tempdir('pi-feed-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my ($tmpdir, $for_destroy) = tmpdir();
my $git_dir = "$tmpdir/gittest";
my $ibx = PublicInbox::Inbox->new({
address => 'test@example',
name => 'testbox',
inboxdir => $git_dir,
- url => 'http://example.com/test',
+ url => [ 'http://example.com/test' ],
feedmax => 3,
});
my $git = $ibx->git;