X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Factions.t;fp=t%2Factions.t;h=1b8b1fbad85ef877b35f0b3e30485b8a9fc1c7e6;hb=c84b68f396fb5b0e81dbae8927519b2e06138734;hp=7647fd79e902b468b6bb901a423e06027a2ada27;hpb=ee05be727a50b74d2322b9dbaee232ce428e3d3e;p=catagits%2FHTML-Zoom.git diff --git a/t/actions.t b/t/actions.t index 7647fd7..1b8b1fb 100644 --- a/t/actions.t +++ b/t/actions.t @@ -58,9 +58,9 @@ is( ($expect = $tmpl) =~ s/name="cow" class="main"/name="bar" class="foo"/; is( - run_for { $_->set_attribute({ 'class' => 'foo', 'name' => 'bar'}) }, + run_for { $_->set_attr({ 'class' => 'foo', 'name' => 'bar'}) }, $expect, - 'set attributes using hashref form' + 'set attributes using hashref form (shorthand)' ); ($expect = $tmpl) =~ s/class="main"/class="main" foo="bar"/; @@ -117,6 +117,14 @@ is( 'remove attribute on non existing attribute' ); +($expect = $tmpl) =~ s/class="main"/class=""/; + +is( + run_for { $_->remove_from_attribute({ class => 'main' }) }, + $expect, + 'remove name from attribute' +); + ($expect = $tmpl) =~ s/ class="main"//; is(