]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/feed.t
tests: move t/common.perl to PublicInbox::TestCommon
[public-inbox.git] / t / feed.t
index eb1f35fb0158e6aa357b4f07cde8927040b8a300..97468c730f0dc242cf06484cecb72adc70c1cdef 100644 (file)
--- a/t/feed.t
+++ b/t/feed.t
@@ -9,15 +9,21 @@ 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',