about summary refs log tree commit homepage
path: root/t/filter_mirror.t
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-25 05:52:21 +0000
committerEric Wong <e@yhbt.net>2020-04-26 07:03:12 +0000
commit5d8dbb4aca5afcc6b98a4d951f03003fb7eaf356 (patch)
treeb26c754dd2822193f4fb6e96e8cad8e660cbf246 /t/filter_mirror.t
parent58852a50f6a72265cce1e4729aae3875bba5aa96 (diff)
downloadpublic-inbox-5d8dbb4aca5afcc6b98a4d951f03003fb7eaf356.tar.gz
We'll use this to create, memoize, and reuse .eml files.  This
will be used to reduce (and eventually eliminate) our dependency
on Email::MIME in tests.
Diffstat (limited to 't/filter_mirror.t')
-rw-r--r--t/filter_mirror.t9
1 files changed, 5 insertions, 4 deletions
diff --git a/t/filter_mirror.t b/t/filter_mirror.t
index b1946146..694209d9 100644
--- a/t/filter_mirror.t
+++ b/t/filter_mirror.t
@@ -3,12 +3,13 @@
 use strict;
 use warnings;
 use Test::More;
-use Email::MIME;
+use PublicInbox::TestCommon;
 use_ok 'PublicInbox::Filter::Mirror';
 
 my $f = PublicInbox::Filter::Mirror->new;
 ok($f, 'created PublicInbox::Filter::Mirror object');
 {
+        my $email = mime_load 't/filter_mirror.eml', sub {
         my $html_body = "<html><body>hi</body></html>";
         my $parts = [
                 Email::MIME->create(
@@ -26,15 +27,15 @@ ok($f, 'created PublicInbox::Filter::Mirror object');
                         body => 'hi = "bye"',
                 )
         ];
-        my $email = Email::MIME->create(
+        Email::MIME->create(
                 header_str => [
                   From => 'a@example.com',
                   Subject => 'blah',
                   'Content-Type' => 'multipart/alternative'
                 ],
                 parts => $parts,
-        );
+        )}; # mime_laod sub
         is($f->ACCEPT, $f->delivery($email), 'accept any trash that comes');
 }
 
-done_testing();
+ done_testing();