X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fsynopsis%2Ffilterbuilder.t;h=f68cfc59626d22996f2ca3038eda6df9121e1554;hb=484f42058536d0cae692241fc29967f1c42d315a;hp=9769c3dfff2353ae424f5c42679f06b4dda5e135;hpb=0d8f057ed479290d61f84e13ae6b3efec78813dd;p=catagits%2FHTML-Zoom.git diff --git a/t/synopsis/filterbuilder.t b/t/synopsis/filterbuilder.t index 9769c3d..f68cfc5 100644 --- a/t/synopsis/filterbuilder.t +++ b/t/synopsis/filterbuilder.t @@ -1,7 +1,8 @@ -use strict; -use warnings FATAL => 'all'; +use strictures 1; use Test::More qw(no_plan); + + use HTML::Zoom; my $root = HTML::Zoom ->from_html(< Default Title - + Default Content MAIN + + +$root = $root + ->select('body') + ->set_attribute(class=>'main'); + + + +$root = $root + ->select('body') + ->add_to_attribute(class=>'one-column'); + + + +$root = $root + ->select('title') + ->replace_content('Hello World'); + + + my $body = HTML::Zoom ->from_html(< -

Stuff

+

Well Now

+

Is the Time

BODY -my $output = $root -->select('title') -->replace_content('Hello World') -->select('body') -->replace_content($body) -->to_html; +$root = $root + ->select('body') + ->replace_content($body); + + + +$root = $root + ->select('p') + ->set_attribute(class=>'para'); + + + +$root = $root + ->select('body') + ->remove_attribute('bad_attr'); +my $output = $root->to_html; my $expect = < Hello World -
-

Stuff

+
+

Well Now

+

Is the Time