remove die as it stops actual use cases allocate_mobile
Simon Elliott [Tue, 23 Apr 2013 10:16:53 +0000 (11:16 +0100)]
lib/HTML/Zoom/FilterBuilder.pm
t/dwim-autoload.t

index cabe817..49cd04f 100644 (file)
@@ -42,9 +42,9 @@ sub set_attribute {
 sub _parse_attribute_args {
   my $self = shift;
 
-  die "Long form arg (name => 'class', value => 'x') is no longer supported"
-    if(@_ == 1 && $_[0]->{'name'} && $_[0]->{'value'});
-    
+  #die "Long form arg (name => 'class', value => 'x') is no longer supported"
+    #if(@_ == 1 && $_[0]->{'name'} && $_[0]->{'value'});
+
   my $opts = ref($_[0]) eq 'HASH' ? $_[0] : {$_[0] => $_[1]};
   for (values %{$opts}) { $self->_zconfig->parser->html_escape($_); }
   return $opts;
index 8765a99..d87d456 100644 (file)
@@ -115,6 +115,15 @@ like(
   'Got correct from set_attribute'
 );
 
+like(
+  HTML::Zoom
+    ->from_html(q[<p class="first">Hi!</p>])
+    ->set_attribute('p.first' => { class => 'para' })
+    ->to_html,
+  qr/class="para"/,
+  'Got correct from set_attribute (via hashref)'
+);
+
 is(
   HTML::Zoom
     ->from_html(q[<p class="first">Hi!</p>])