Fix Makefile.PL, reword Changes to be more in line with reality. multipart will
[p5sagit/Email-Archive.git] / t / basic.t
CommitLineData
8581da38 1#!/usr/bin/perl
2use strict;
3use warnings;
5e15a8a0 4use Email::MIME;
5
6use Test::More;
8581da38 7
8581da38 8use Email::Archive;
9
5e15a8a0 10my $email = Email::MIME->create(
8581da38 11 header => [
c5f5125c 12 From => 'foo@example.com',
8581da38 13 To => 'drain@example.com',
14 Subject => 'Message in a bottle',
15 'Message-ID' => 'helloworld',
16 ],
17 body => 'hello there!'
18);
19
c5f5125c 20my $e = Email::Archive->new();
5e15a8a0 21$e->connect('dbi:SQLite:dbname=t/test.db');
8581da38 22$e->store($email);
23
24my $found = $e->retrieve('helloworld');
5e15a8a0 25cmp_ok($found->header('subject'), 'eq', "Message in a bottle",
26 "can find stored message by ID");
27
28done_testing;
29unlink 't/test.db';