X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fsynopsis%2Ffilterbuilder.t;h=1112109e485dce224af7a47d91564979abaf5ffd;hb=a42917f6295747a1b4b3d081db5e2f1feaca9d00;hp=59048aee4cbfc1033baa40218973de6a65c1d35e;hpb=adb30a8ac700a4a4f26dafaaef0806c05fd8768a;p=catagits%2FHTML-Zoom.git diff --git a/t/synopsis/filterbuilder.t b/t/synopsis/filterbuilder.t index 59048ae..1112109 100644 --- a/t/synopsis/filterbuilder.t +++ b/t/synopsis/filterbuilder.t @@ -2,6 +2,8 @@ use strict; use warnings FATAL => 'all'; 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(<

Well Now

-

Is the Time

+

Is the Time

BODY -my $output = $root -->select('title') -->replace_content('Hello World') -->select('body') -->replace_content($body) -->select('p') -->set_attribute(class=>'para') -->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 -
+

Well Now

-

Is the Time

+

Is the Time