X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fdwim-autoload.t;h=edf7f38a9defaa1d9bd8a4f59d2c39c76fbafcb0;hb=701459a45dfa55feb465de0201bc93778439c804;hp=54de2fde1b4fac24a1b761ec1815b036bffb8f17;hpb=94a3ddd9ea6e8c859f01407cc17c7042ccf34ba0;p=catagits%2FHTML-Zoom.git
diff --git a/t/dwim-autoload.t b/t/dwim-autoload.t
index 54de2fd..edf7f38 100644
--- a/t/dwim-autoload.t
+++ b/t/dwim-autoload.t
@@ -322,4 +322,42 @@ sub code_stream (&) {
'Got correct from repeat_content';
}
+{
+ ok my $dwim = HTML::Zoom
+ ->from_html(q[
])
+ ->replace_content({
+ 'li.foo' => ['foo'],
+ 'li.bar' => ['bar'],
+ })->to_html;
+ is $dwim, '',
+ '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;