starting to work down the list of methods and figuring out what does what
[catagits/HTML-Zoom.git] / t / synopsis / filterbuilder.t
CommitLineData
0d8f057e 1use strict;
2use warnings FATAL => 'all';
3use Test::More qw(no_plan);
4
5use HTML::Zoom;
6my $root = HTML::Zoom
7 ->from_html(<<MAIN);
8<html>
9 <head>
10 <title>Default Title</title>
11 </head>
12 <body>
13 Default Content
14 </body>
15</html>
16MAIN
17
18my $body = HTML::Zoom
19 ->from_html(<<BODY);
20<div id="stuff">
adb30a8a 21 <p>Well Now</p>
22 <p>Is the Time</p>
0d8f057e 23</div>
24BODY
25
26my $output = $root
27->select('title')
28->replace_content('Hello World')
29->select('body')
30->replace_content($body)
adb30a8a 31->select('p')
32->set_attribute(class=>'para')
0d8f057e 33->to_html;
34
35
36my $expect = <<HTML;
37<html>
38 <head>
39 <title>Hello World</title>
40 </head>
41 <body><div id="stuff">
adb30a8a 42 <p class="para">Well Now</p>
43 <p class="para">Is the Time</p>
0d8f057e 44</div>
45</body>
46</html>
47HTML
48is($output, $expect, 'Synopsis code works ok');
49