]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/cgi.t
t/cgi.t: show stderr on failures
[public-inbox.git] / t / cgi.t
diff --git a/t/cgi.t b/t/cgi.t
index 42a343d3040f06303fb42a09cce5c22f6b07f65a..96c627c384e8d3ce1acf1c3a83d3eba0140d280b 100644 (file)
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -5,7 +5,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::TestCommon;
 use PublicInbox::Import;
 require_mods(qw(Plack::Handler::CGI Plack::Util));
@@ -39,13 +39,13 @@ use_ok 'PublicInbox::InboxWritable';
 use_ok 'PublicInbox::Config';
 my $cfg = PublicInbox::Config->new($pi_config);
 my $ibx = $cfg->lookup_name('test');
-my $im = PublicInbox::InboxWritable->new($ibx)->importer;
+my $im = PublicInbox::InboxWritable->new($ibx)->importer(0);
 
 {
        local $ENV{HOME} = $home;
 
        # inject some messages:
-       my $mime = PublicInbox::MIME->new(<<EOF);
+       my $mime = PublicInbox::Eml->new(<<EOF);
 From: Me <me\@example.com>
 To: You <you\@example.com>
 Cc: $addr
@@ -62,7 +62,7 @@ EOF
        ok($im->add($mime), 'added big message');
 
        # deliver a reply, too
-       $mime = PublicInbox::MIME->new(<<EOF);
+       $mime = PublicInbox::Eml->new(<<EOF);
 From: You <you\@example.com>
 To: Me <me\@example.com>
 Cc: $addr
@@ -79,7 +79,7 @@ EOF
        ok($im->add($mime), 'added reply');
 
        my $slashy_mid = 'slashy/asdf@example.com';
-       my $slashy = PublicInbox::MIME->new(<<EOF);
+       my $slashy = PublicInbox::Eml->new(<<EOF);
 From: You <you\@example.com>
 To: Me <me\@example.com>
 Cc: $addr
@@ -158,7 +158,7 @@ sub cgi_run {
        my ($in, $out, $err) = ("", "", "");
        my $rdr = { 0 => \$in, 1 => \$out, 2 => \$err };
        run_script(['.cgi'], \%env, $rdr);
-       die "unexpected error: \$?=$?" if $?;
+       die "unexpected error: \$?=$? ($err)" if $?;
        my ($head, $body) = split(/\r\n\r\n/, $out, 2);
        { head => $head, body => $body, err => $err }
 }