From: Simon Elliott Date: Fri, 20 May 2011 09:33:10 +0000 (+0100) Subject: test for hashref support on codestream X-Git-Tag: allocate~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FHTML-Zoom.git;a=commitdiff_plain;h=701459a45dfa55feb465de0201bc93778439c804 test for hashref support on codestream --- diff --git a/t/dwim-autoload.t b/t/dwim-autoload.t index 405543e..edf7f38 100644 --- a/t/dwim-autoload.t +++ b/t/dwim-autoload.t @@ -330,7 +330,7 @@ sub code_stream (&) { 'li.bar' => ['bar'], })->to_html; is $dwim, '', - 'Multiple selectors from hashref (via replace_content)'; + 'Hashref selectors (via replace_content)'; } { @@ -341,7 +341,23 @@ sub code_stream (&) { 'li.bar' => [ class => 'qux' ], })->to_html; is $dwim, '', - 'Multiple selectors from hashref (via set_attribute)'; + 'Hashref selectors (via set_attribute)'; +} + +{ + ok my $dwim = HTML::Zoom + ->from_html(q[]) + ->select('ul')->collect({ + passthrough => 1, + filter => sub { + $_->set_attribute({ + 'li.foo' => [ class => 'baz' ], + 'li.bar' => [ class => 'qux' ], + }); + } + })->to_html; + is $dwim, '', + 'Hashref selectors on codestream'; } done_testing;