-
- my $git = PublicInbox::Git->new($maindir);
- my $im = PublicInbox::Import->new($git, 'test', $addr);
- $im->add($mime);
- $im->done($mime);
+ };
+ my $i2 = create_inbox 'test-2', sub {
+ my ($im, $ibx) = @_;
+ $im->add(eml_load('t/plack-qp.eml')) or xbail '->add';
+ };
+ local $ENV{HOME} = $home;
+ my $cmd = [ '-init', $group, $inboxdir, 'http://example.com/', $addr ];
+ ok(run_script($cmd), 'init ran properly');
+ $cmd = [ '-httpd', '-W0', "--stdout=$out", "--stderr=$err" ];
+ $td = start_script($cmd, undef, { 3 => $sock });
+ my $http_pfx = 'http://'.tcp_host_port($sock);
+ {
+ my $bad = tcp_connect($sock);
+ print $bad "GETT / HTTP/1.0\r\n\r\n" or die;
+ like(<$bad>, qr!\AHTTP/1\.[01] 405\b!, 'got 405 on bad req');