root/trunk/plagger/t/plugins/Publish-Takahashi/publish.t

Revision 1656 (checked in by miyagawa, 14 years ago)
  • Updated captured variable name to $warnings.
  • Fixed POD bug in Publish::Takahashi
  • Updated ID of Publish::Takahashi test to use MD5 of file path, since it depends on local path, Eh.
  • Added failing test for Planet XSS bug
Line 
1 use strict;
2 use FindBin;
3 use t::TestPlagger;
4 use File::Spec;
5 use Digest::MD5 qw(md5_hex);
6
7 our $url = "file://$t::TestPlagger::BaseDirURI/t/samples/rss-full.xml";
8 my $id = md5_hex($url);
9
10 our $output = File::Spec->rel2abs("$FindBin::Bin/$id.xul");
11 our $css    = File::Spec->rel2abs("$FindBin::Bin/takahashi.css");
12 our $js     = File::Spec->rel2abs("$FindBin::Bin/takahashi.js");
13
14 test_plugin_deps;
15 plan 'no_plan';
16 run_eval_expected;
17
18 END {
19     unlink $output if -e $output;
20     unlink $css    if -e $css;
21     unlink $js     if -e $js;
22 }
23
24 __END__
25
26 === Takahashi
27 --- input config output_file
28 plugins:
29   - module: Subscription::Config
30     config:
31       feed:
32         - $main::url
33   - module: Publish::Takahashi
34     config:
35       dir: $FindBin::Bin
36 --- expected
37
38 # check the file exists
39 ok -f $main::output;
40 ok -s $main::output > 1024;
41
42 # check that the file contents matches
43 file_contains($main::output, qr/Consolas/);
44
45 # check we also included the takahashi files
46 ok -f $main::css;
47 ok -f $main::js;
Note: See TracBrowser for help on using the browser.