root/perl/SWISH-Prog/trunk/t/04_mail.t

Revision 2186, 0.8 kB (checked in by karpet, 2 months ago)

0.21 release

Line 
1 use Test::More tests => 5;
2
3 use_ok('SWISH::Prog::Indexer::Native');
4
5 SKIP: {
6
7     eval "use SWISH::Prog::Aggregator::Mail";
8     if ($@) {
9         skip "mail test requires Mail::Box", 4;
10     }
11
12     # is executable present?
13     my $indexer = SWISH::Prog::Indexer::Native->new;
14     if ( !$indexer->swish_check ) {
15         skip "swish-e not installed", 4;
16     }
17
18     #maildir requires these dirs but makemaker won't package them
19     mkdir('t/maildir/cur');
20     mkdir('t/maildir/tmp');
21     mkdir('t/maildir/new');
22
23     ok( my $mail = SWISH::Prog::Aggregator::Mail->new(
24             indexer => SWISH::Prog::Indexer::Native->new(),
25             verbose => $ENV{PERL_DEBUG},
26         ),
27         "new mail aggregator"
28     );
29
30     ok( $mail->indexer->start, "start" );
31     is( $mail->crawl('t/maildir'), 1, "crawl" );
32     ok( $mail->indexer->finish, "finish" );
33
34 }
Note: See TracBrowser for help on using the browser.