8 eval q{use Test::More skip_all => "XML::Feed not available"};
11 eval q{use Test::More tests => 36};
16 my $baseurl = 'http://example.com';
17 my @command = (qw(./ikiwiki.out -plugin inline -rss -atom));
18 push @command, qw(-underlaydir=underlays/basewiki);
19 push @command, qw(-set underlaydirbase=underlays -templatedir=templates);
20 push @command, "-url=$baseurl", qw(t/tinypodcast t/tmp/out);
22 ok(! system("mkdir t/tmp"));
23 ok(! system(@command));
26 'piano.mp3' => 'audio/mpeg',
27 'scroll.3gp' => 'video/3gpp',
28 'walter.ogg' => 'video/x-theora+ogg',
31 for my $format (qw(atom rss)) {
32 my $feed = XML::Feed->parse("t/tmp/out/index.$format");
34 is($feed->title, 'wiki', qq{$format feed title});
35 is($feed->link, "$baseurl/", qq{$format feed link});
36 is($feed->description, $feed->title, qq{$format feed description});
37 if ('atom' eq $format) {
38 is($feed->author, $feed->title, qq{$format feed author});
39 is($feed->id, "$baseurl/", qq{$format feed id});
40 is($feed->generator, "ikiwiki", qq{$format feed generator});
43 for my $entry ($feed->entries) {
44 my $title = $entry->title;
46 my $enclosure = $entry->enclosure;
48 is($url, "$baseurl/$title", qq{$format $title id});
49 is($entry->link, $url, qq{$format $title link});
50 is($enclosure->url, $url, qq{$format $title enclosure url});
51 is($enclosure->type, $media_types{$title}, qq{$format $title enclosure type});
52 # is($enclosure->length, '12345', qq{$format $title enclosure length});
58 ok(! system("rm -rf t/tmp t/tinypodcast/.ikiwiki"));