File: 04_style_script.t

package info (click to toggle)
libhtml-scrubber-perl 0.08-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 132 kB
  • ctags: 23
  • sloc: perl: 325; makefile: 43
file content (27 lines) | stat: -rw-r--r-- 770 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# perl Makefile.PL && nmake realclean && cls && perl Makefile.PL && nmake test

use strict;
use Test::More tests => 9; 
BEGIN { $^W = 1 }

use_ok( 'HTML::Scrubber' );

my $s = HTML::Scrubber->new;
my $html = q[start <style>in the style</style> middle <script>in the script</script> end];

isa_ok($s, 'HTML::Scrubber');

is( $s->script, 0, 'script off by default');
is( $s->style, 0, 'style off by default');
is( $s->scrub($html), 'start  middle  end', 'default (no style no script)');


$s->script(1);
is( $s->script, 1, 'script on');
is( $s->scrub($html), 'start  middle in the script end', 'script off');



$s->style(1);
is( $s->style, 1, 'style on');
is( $s->scrub($html), 'start in the style middle in the script end', 'style off and script off');