root/branches/feature-geo/plagger/t/plugins/Namespace-MediaRSS/base.t

Revision 1858 (checked in by miyagawa, 14 years ago)

Namespace::MediaRSS: Added test to extract tags from urn:flickr:tags

Line 
1 use strict;
2 use FindBin;
3
4 use t::TestPlagger;
5
6 plan tests => 7;
7 run_eval_expected;
8
9 __END__
10
11 === Media RSS
12 --- input config
13 global:
14   log:
15     level: error
16 plugins:
17   - module: Subscription::Config
18     config:
19       feed:
20         - file://$t::TestPlagger::BaseDirURI/t/samples/monkey.rss
21         - file://$t::TestPlagger::BaseDirURI/t/samples/googlevideo.xml
22         - file://$t::TestPlagger::BaseDirURI/t/samples/flickr-geo.xml
23 --- expected
24 my @feeds = $context->update->feeds;
25
26 is( $feeds[0]->entries->[0]->enclosures->[0]->url, 'http://youtube.com/v/MgldehkjK5k.swf' );
27 is( $feeds[0]->entries->[0]->enclosures->[0]->type, 'application/x-shockwave-flash' );
28 is( $feeds[0]->entries->[0]->icon->{url}, 'http://sjl-static4.sjl.youtube.com/vi/MgldehkjK5k/2.jpg' );
29 is( $feeds[1]->entries->[0]->enclosures->[0]->type, 'video/mp4' );
30 is( $feeds[1]->entries->[0]->enclosures->[1]->type, 'video/x-flv' );
31 is( $feeds[1]->entries->[0]->icon->{url}, 'http://video.google.com/ThumbnailServer?app=vss&contentid=ac22092b58659308&second=5&itag=w320&urlcreated=1148908032&sigh=oxDLuV7bChBhYFMFSFamVpkIHHE' );
32
33 is_deeply $feeds[2]->entries->[0]->tags, [ qw( geotagged geolat354684867 geolon1351218208 ) ];
Note: See TracBrowser for help on using the browser.