root/trunk/plagger/t/plugins/Filter-DegradeYouTube/base.t

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

add Filter::DegradeYoutube? via http://d.hatena.ne.jp/tokuhirom/20061008/1160271366

Line 
1 use strict;
2 use t::TestPlagger;
3
4 test_plugin_deps;
5 plan 'no_plan';
6 run_eval_expected;
7
8 __END__
9
10 === Loading Filter::DegradeYouTube
11 --- input config
12 plugins:
13   - module: Filter::DegradeYouTube
14 --- expected
15 ok 1, $block->name;
16
17 === no dev_id
18 --- input config
19 plugins:
20   - module: Filter::DegradeYouTube
21
22   - module: CustomFeed::Debug
23     config:
24       title: feed title
25       entry:
26         - title: frepa
27           link: http://www.frepa.livedoor.com/blog/show?id=4&diary=60231
28           body: <object width="340" height="280"><param name="movie" value="http://www.youtube.com/v/nf8LyHLN2x4"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/nf8LyHLN2x4"  type="application/x-shockwave-flash" wmode="transparent"  width="340" height="280"></embed></object>
29 --- expected
30 like $context->update->feeds->[0]->entries->[0]->body, qr{<a href="http://www.youtube.com/v/nf8LyHLN2x4">YouTube Movie</a>}, "degrade with no dev_id";
31
32 === with dev_id
33 --- input config
34 plugins:
35   - module: Filter::DegradeYouTube
36     config:
37       dev_id: DkL0TIF7LpQ
38
39   - module: CustomFeed::Debug
40     config:
41       title: feed title
42       entry:
43         - title: frepa
44           link: http://www.frepa.livedoor.com/blog/show?id=4&diary=60231
45           body: <object width="340" height="280"><param name="movie" value="http://www.youtube.com/v/nf8LyHLN2x4"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/nf8LyHLN2x4"  type="application/x-shockwave-flash" wmode="transparent"  width="340" height="280"></embed></object>
46 --- expected
47 like $context->update->feeds->[0]->entries->[0]->body, qr{<a href="http://www.youtube.com/v/nf8LyHLN2x4"><img src="http://sjl-static16.sjl.youtube.com/vi/nf8LyHLN2x4/2.jpg" /></a>}, "degrade with thumbnail";
Note: See TracBrowser for help on using the browser.