]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/v2mda.t
replace most uses of PublicInbox::MIME with Eml
[public-inbox.git] / t / v2mda.t
index c2118a89cf271c0f7240534a2c7bc2cb27766da9..4d3ec30db91e4b99ac076826841d53e3e81a2ba0 100644 (file)
--- a/t/v2mda.t
+++ b/t/v2mda.t
@@ -3,10 +3,10 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
 use Fcntl qw(SEEK_SET);
 use Cwd;
 use PublicInbox::TestCommon;
+use PublicInbox::MIME;
 require_git(2.6);
 
 my $V = 2;
@@ -18,18 +18,16 @@ my $ibx = {
        name => 'test-v2writable',
        address => [ 'test@example.com' ],
 };
-my $mime = PublicInbox::MIME->create(
-       header => [
-               From => 'a@example.com',
-               To => 'test@example.com',
-               Subject => 'this is a subject',
-               Date => 'Fri, 02 Oct 1993 00:00:00 +0000',
-               'Message-ID' => '<foo@bar>',
-               'List-ID' => '<test.example.com>',
-       ],
-       body => "hello world\n",
-);
+my $mime = PublicInbox::MIME->new(<<'EOF');
+From: a@example.com
+To: test@example.com
+Subject: this is a subject
+Date: Fri, 02 Oct 1993 00:00:00 +0000
+Message-ID: <foo@bar>
+List-ID: <test.example.com>
 
+hello world
+EOF
 my $main_bin = getcwd()."/t/main-bin";
 my $fail_bin = getcwd()."/t/fail-bin";
 local $ENV{PI_DIR} = "$tmpdir/foo";
@@ -72,7 +70,7 @@ is($saved->{mime}->as_string, $mime->as_string, 'injected message');
        my $config = "$ENV{PI_DIR}/config";
        ok(-f $config, 'config exists');
        my $k = 'publicinboxmda.spamcheck';
-       is(system('git', 'config', "--file=$config", $k, 'none'), 0,
+       is(xsys('git', 'config', "--file=$config", $k, 'none'), 0,
                'disabled spamcheck for mda');
 
        ok(run_script(['-mda'], undef, $rdr), 'mda did not die');