made the new FilterBuilder synopsis pass its test
[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">
21 <p>Stuff</p>
22</div>
23BODY
24
25my $output = $root
26->select('title')
27->replace_content('Hello World')
28->select('body')
29->replace_content($body)
30->to_html;
31
32
33my $expect = <<HTML;
34<html>
35 <head>
36 <title>Hello World</title>
37 </head>
38 <body><div id="stuff">
39 <p>Stuff</p>
40</div>
41</body>
42</html>
43HTML
44is($output, $expect, 'Synopsis code works ok');
45