Changeset 1625

Show
Ignore:
Timestamp:
08/29/06 17:45:05
Author:
miyagawa
Message:

redo HTMLScrubber test to test if it doesn't filter non-HTML thing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/hackathon-summary/plagger/t/plugins/Filter-HTMLScrubber/base.t

    r1622 r1625  
    44test_plugin_deps; 
    55plan 'no_plan'; 
    6 run_eval_expected
     6run_eval_expected_with_capture
    77 
    88__END__ 
     
    1111--- input config 
    1212plugins: 
    13   - module: CustomFeed::Debug 
    14     config: 
    15       title: foo 
    16       link: 'http://www.example.net/' 
    17       entry: 
    18         - title: bar 
    19           link: 'http://www.example.net/1' 
    20           body: | 
    21             <script type="text/javascript"> 
    22             function pla() { 
    23                 alert("Plagger is a pluggable aggregator"); 
    24             } 
    25             </script> 
    26             <p> 
    27                 <a href="#" onclick="pla()">Plagger is a pluggable aggregator</a> 
    28             </p> 
    2913  - module: Filter::HTMLScrubber 
    3014--- expected 
    3115ok 1, $block->name; 
    32 unlike $context->update->feeds->[0]->entries->[0]->body, qr!</?script .*?>!sm; 
    3316 
     17=== Simple test 
     18--- input config 
     19plugins: 
     20  - module: CustomFeed::Debug 
     21    config: 
     22      title: Foo Bar 
     23      entry: 
     24        - title: Nasty 
     25          body: Foo <style>bar</style> 
     26  - module: Filter::HTMLScrubber 
     27--- expected 
     28unlike $context->update->feeds->[0]->entries->[0]->body, qr!<style>bar</style>! 
     29 
     30=== Don't scrub non-HTML 
     31--- input config 
     32global: 
     33  log: 
     34    level: debug 
     35plugins: 
     36  - module: CustomFeed::Debug 
     37    config: 
     38      title: Foo Bar 
     39      entry: 
     40        - title: Nasty 
     41          body: This is not HTML. 
     42  - module: Filter::HTMLScrubber 
     43--- expected 
     44unlike $warning, qr/Scrubbing/; 
     45 
     46