9 use Email::Archive::Storage::DBIC;
11 my $email = Email::MIME->create(
13 From => 'foo@example.com',
14 To => 'drain@example.com',
15 Subject => 'Message in a bottle',
16 'Message-ID' => 'helloworld',
18 body => 'hello there!'
21 my $e = Email::Archive->new();
22 $e->connect('dbi:SQLite:dbname=t/test.db');
25 my $found = $e->retrieve('helloworld');
26 cmp_ok($found->header('subject'), 'eq', "Message in a bottle",
27 "can find stored message by ID");
29 my $e_dbic = Email::Archive->new(
30 storage => Email::Archive::Storage::DBIC->new,
32 $e_dbic->connect('dbi:SQLite:dbname=t/test_dbic.db');
33 $e_dbic->store($email);
35 $found = $e_dbic->retrieve('helloworld');
36 cmp_ok($found->header('subject'), 'eq', "Message in a bottle",
37 "can find stored message by ID");
42 unlink 't/dbic_test.db';