use Test::More;
use PublicInbox::TestCommon;
require_git(2.6);
-use PublicInbox::MIME;
+use PublicInbox::Eml;
use PublicInbox::Config;
use PublicInbox::MID qw(mids);
require_mods(qw(DBD::SQLite Search::Xapian HTTP::Request::Common Plack::Test
- URI::Escape Plack::Builder Email::MIME));
+ URI::Escape Plack::Builder));
use_ok($_) for (qw(HTTP::Request::Common Plack::Test));
use_ok 'PublicInbox::WWW';
use_ok 'PublicInbox::V2Writable';
my $im = PublicInbox::V2Writable->new($ibx, 1);
$im->{parallel} = 0;
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
From oldbug-pre-a0c07cba0e5d8b6a Fri Oct 2 00:00:00 1993
From: a@example.com
To: test@example.com
# ensure conflicted attachments can be resolved
foreach my $body (qw(old new)) {
- my $parts = [
- Email::MIME->create(
- attributes => { content_type => 'text/plain' },
- body => 'blah',
- ),
- Email::MIME->create(
- attributes => {
- filename => 'attach.txt',
- content_type => 'text/plain',
- },
- body => $body
- )
- ];
- $mime = Email::MIME->create(
- parts => $parts,
- header_str => [ From => 'root@z',
- 'Message-ID' => '<a@dup>',
- Subject => 'hi']
- );
+ $mime = eml_load "t/psgi_v2-$body.eml";
ok($im->add($mime), "added attachment $body");
}
$im->done;