root/lang/perl/plagger/t/plugins/Filter-FLVInfo/base.t @ 433

Revision 433, 1.8 kB (checked in by otsune, 7 years ago)

lang/perl/plagger/t/plugins/Filter-FLVInfo/base.t: add test with local flv file

Line 
1use strict;
2use FindBin;
3use File::Path qw(rmtree);
4
5BEGIN {
6    use t::TestPlagger;
7    test_requires_network('mizzy.org:80');
8}
9
10our $tmpdir = "$FindBin::Bin/tmp";
11
12plan 'no_plan';
13
14run_eval_expected;
15
16END { rmtree $tmpdir if $tmpdir }
17
18__END__
19
20=== Test Filter::FLVInfo
21--- input config
22plugins:
23  - module: CustomFeed::Debug
24    config:
25      title: 'Test Filter::FLVInfo'
26      link: 'http://mizzy.org/plagger-test/'
27      entry:
28        - title: 'First Entry'
29          link: 'http://mizzy.org/plagger-test/'
30          body: 'Test Filter::FLVInfo'
31          summary: 'Test Filter::FLVInfo'
32          author: 'Yohei Fushii'
33          enclosure:
34            - url: http://mizzy.org/plagger-test/mizzy.flv
35        - title: 'Second Entry'
36          link: 'http://plagger.org/trac/browser/trunk/plagger/lib/Plagger/Plugin/Filter/FLVInfo.pm'
37          body: 'Test Filter::FLVInfo'
38          summary: 'Test Filter::FLVInfo'
39          author: 'Yohei Fushii'
40          enclosure:
41            - url: http://plagger.org/trac/browser/trunk/plagger/t/samples/plagger-logo-160x120.flv?format=raw
42              local_path: $t::TestPlagger::BaseDirURI/t/samples/plagger-logo-160x120.flv
43
44  - module: Filter::FetchEnclosure
45    rule: 
46      expression: \$args->{entry}->link eq 'http://mizzy.org/plagger-test/';
47    config:
48      dir: $main::tmpdir
49  - module: Filter::FLVInfo
50
51--- expected
52is $context->update->feeds->[0]->entries->[0]->meta->{flvinfo}->{height}, '240';
53is $context->update->feeds->[0]->entries->[0]->meta->{flvinfo}->{width}, '320';
54is $context->update->feeds->[0]->entries->[0]->meta->{flvinfo}->{aspect}, '4:3';
55is $context->update->feeds->[0]->entries->[1]->meta->{flvinfo}->{height}, '120';
56is $context->update->feeds->[0]->entries->[1]->meta->{flvinfo}->{width}, '160';
57is $context->update->feeds->[0]->entries->[1]->meta->{flvinfo}->{aspect}, '4:3';
Note: See TracBrowser for help on using the browser.