root/trunk/plagger/t/plugins/UserAgent-RequestHeader/printenv.t

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

switch UserAgent?::RequestHeader? test to printenv, to avoid SSL issues

Line 
1 use t::TestPlagger;
2 use utf8;
3
4 test_plugin_deps('Filter-EntryFullText', 1);
5 plan 'no_plan';
6 run_eval_expected;
7
8 __END__
9
10 === Test printenv
11 --- input config
12 global:
13   cache:
14     class: Plagger::Cache::Null
15 plugins:
16   - module: CustomFeed::Debug
17     config:
18       title: printenv
19       entry:
20         - title: printenv
21           link: http://commonground.mines.edu/printenv.cgi
22   - module: Filter::EntryFullText
23     config:
24       store_html_on_failure: 1
25 --- expected
26 unlike $context->update->feeds->[0]->entries->[0]->body, qr!ACCEPT_LANGUAGE!;
27
28 === Test printenv with Accept-Language: ja
29 --- input config
30 global:
31   cache:
32     class: Plagger::Cache::Null
33 plugins:
34   - module: CustomFeed::Debug
35     config:
36       title: printenv
37       entry:
38         - title: printenv
39           link: http://commonground.mines.edu/printenv.cgi
40   - module: Filter::EntryFullText
41     config:
42       store_html_on_failure: 1
43   - module: UserAgent::RequestHeader
44     config:
45       Accept-Language: ja
46 --- expected
47 like $context->update->feeds->[0]->entries->[0]->body, qr!<TD>HTTP_ACCEPT_LANGUAGE</TD><TD>ja</TD>!;
48
49 === Test printenv with Accept-Language: ja and rule
50 --- input config
51 global:
52   cache:
53     class: Plagger::Cache::Null
54 plugins:
55   - module: CustomFeed::Debug
56     config:
57       title: printenv
58       entry:
59         - title: printenv
60           link: http://commonground.mines.edu/printenv.cgi
61   - module: Filter::EntryFullText
62     config:
63       store_html_on_failure: 1
64   - module: UserAgent::RequestHeader
65     config:
66       Accept-Language: ja
67     rule:
68       expression: \$args->{url}->host eq 'commonground.mines.edu'
69 --- expected
70 like $context->update->feeds->[0]->entries->[0]->body, qr!<TD>HTTP_ACCEPT_LANGUAGE</TD><TD>ja</TD>!
Note: See TracBrowser for help on using the browser.