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

Revision 1918 (checked in by tomi-ru, 14 years ago)

Add new plugin Filter::Lou and Widget::Simple config for lou_trans.

Line 
1 use strict;
2 use utf8;
3 use t::TestPlagger;
4
5 test_plugin_deps;
6 plan 'no_plan';
7
8 run_eval_expected;
9
10 __END__
11 === translate Lou style
12 --- input config
13 plugins:
14   - module: CustomFeed::Debug
15     config:
16       title: feed title
17       entry:
18         - title: test entry
19           link: http://blog.example.com/sample
20           body: "今年もよろしくお願いします。"
21   - module: Filter::Lou
22
23 --- expected
24 is $context->update->feeds->[0]->entries->[0]->body,
25    "ディスイヤーもよろしくプリーズします。";
26
27 === translate Lou style (HTML markup)
28 --- input config
29 plugins:
30   - module: CustomFeed::Debug
31     config:
32       title: feed title
33       entry:
34         - title: test entry
35           link: http://blog.example.com/sample
36           body: "美しい国、日本を考えています。"
37   - module: Filter::Lou
38     config:
39       lou_rate: 100
40       html_fx_rate: 100
41
42 --- expected
43 like $context->update->feeds->[0]->entries->[0]->body,
44    qr{^
45    <FONT.*?>ビューティフル<.*?/FONT>な国、<FONT.*?>ジャパン<.*?/FONT>を
46    <FONT.*?>シンクアバウト<.*?/FONT>しています。
47    $}x;
48
49 === translate Lou style (With <ruby>)
50 --- input config
51 plugins:
52   - module: CustomFeed::Debug
53     config:
54       title: feed title
55       entry:
56         - title: test entry
57           link: http://blog.example.com/sample
58           body: "信頼に報いなければならぬ"
59   - module: Filter::Lou
60     config:
61       format: "<ruby><rb>%s</rb><rp>(</rp><rt>%s</rt><rp>)</rp></ruby>"
62
63 --- expected
64 is $context->update->feeds->[0]->entries->[0]->body,
65     "<ruby><rb>トラスト</rb><rp>(</rp><rt>信頼</rt><rp>)</rp></ruby>に報いなければならぬ";
66
Note: See TracBrowser for help on using the browser.