- my $git = PublicInbox::Git->new($git_dir);
- my $im = PublicInbox::Import->new($git, 'testbox', 'test@example');
- $im->init_bare;
- $im->add(Email::MIME->create(
- header => [
- From => 'a@example.com',
- To => 'b@example.com',
- 'Content-Type' => 'text/plain',
- Subject => 'boo!',
- 'Message-ID' => '<a@example.com>',
- ],
- body => "hello world gmane:666\n",
- ));
- $im->done;
-}
-{
- $ibx = PublicInbox::Inbox->new({inboxdir => $git_dir});
+ $ibx = create_inbox 'testbox', tmpdir => $git_dir, sub {
+ my ($im) = @_;
+ $im->add(PublicInbox::Eml->new(<<'EOF'));
+From: a@example.com
+To: b@example.com
+Subject: boo!
+Message-ID: <a@example.com>
+
+hello world gmane:666
+EOF
+ };