]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/feed.t
update copyrights for 2021
[public-inbox.git] / t / feed.t
index cfa09a7c68eae9549668c40b07589d8b20d6c3c4..cdbc88cd92cd6a51d5a02ea0960323bf31940cfb 100644 (file)
--- a/t/feed.t
+++ b/t/feed.t
@@ -1,9 +1,9 @@
-# Copyright (C) 2014-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2014-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use warnings;
 use Test::More;
-use Email::MIME;
+use PublicInbox::Eml;
 use PublicInbox::Feed;
 use PublicInbox::Import;
 use PublicInbox::Inbox;
@@ -34,11 +34,9 @@ my $git = $ibx->git;
 my $im = PublicInbox::Import->new($git, $ibx->{name}, 'test@example');
 
 {
-       is(0, system(qw(git init -q --bare), $git_dir), "git init");
-       local $ENV{GIT_DIR} = $git_dir;
-
+       $im->init_bare;
        foreach my $i (1..6) {
-               my $mime = Email::MIME->new(<<EOF);
+               my $mime = PublicInbox::Eml->new(<<EOF);
 From: ME <me\@example.com>
 To: U <u\@example.com>
 Message-Id: <$i\@example.com>
@@ -77,7 +75,7 @@ EOF
 {
        # check initial feed
        {
-               my $feed = string_feed({ -inbox => $ibx });
+               my $feed = string_feed({ ibx => $ibx });
                SKIP: {
                        skip 'XML::TreePP missing', 3 unless $have_xml_treepp;
                        my $t = XML::TreePP->new->parse($feed);
@@ -97,7 +95,7 @@ EOF
        # add a new spam message
        my $spam;
        {
-               $spam = Email::MIME->new(<<EOF);
+               $spam = PublicInbox::Eml->new(<<EOF);
 From: SPAMMER <spammer\@example.com>
 To: U <u\@example.com>
 Message-Id: <this-is-spam\@example.com>
@@ -111,7 +109,7 @@ EOF
 
        # check spam shows up
        {
-               my $spammy_feed = string_feed({ -inbox => $ibx });
+               my $spammy_feed = string_feed({ ibx => $ibx });
                SKIP: {
                        skip 'XML::TreePP missing', 2 unless $have_xml_treepp;
                        my $t = XML::TreePP->new->parse($spammy_feed);
@@ -129,7 +127,7 @@ EOF
 
        # spam no longer shows up
        {
-               my $feed = string_feed({ -inbox => $ibx });
+               my $feed = string_feed({ ibx => $ibx });
                SKIP: {
                        skip 'XML::TreePP missing', 2 unless $have_xml_treepp;
                        my $t = XML::TreePP->new->parse($feed);