X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fdwim-autoload.t;h=edf7f38a9defaa1d9bd8a4f59d2c39c76fbafcb0;hb=701459a45dfa55feb465de0201bc93778439c804;hp=6441d1fc8cb7c24f28ded35a44c0015b76024da6;hpb=6af04df5d563b2044ff7d65c88f977557ec17e48;p=catagits%2FHTML-Zoom.git diff --git a/t/dwim-autoload.t b/t/dwim-autoload.t index 6441d1f..edf7f38 100644 --- a/t/dwim-autoload.t +++ b/t/dwim-autoload.t @@ -330,7 +330,34 @@ sub code_stream (&) { 'li.bar' => ['bar'], })->to_html; is $dwim, '', - 'Multiple selectors from hashref'; + 'Hashref selectors (via replace_content)'; +} + +{ + ok my $dwim = HTML::Zoom + ->from_html(q[]) + ->set_attribute({ + 'li.foo' => [ class => 'baz' ], + 'li.bar' => [ class => 'qux' ], + })->to_html; + is $dwim, '', + '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;