X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FHTML-Zoom.git;a=blobdiff_plain;f=t%2Factions.t;fp=t%2Factions.t;h=dbfda0b1fb976a435b5c64436daf98abf2f34207;hp=4e3315be269a8751224db40f4cdcf694d6f6ce9b;hb=3c53c43950487cb2a92d0f49a8932c37867a6ba0;hpb=948f7b2a1c6136a730e0ffc1c738c5f57b74a2ba diff --git a/t/actions.t b/t/actions.t index 4e3315b..dbfda0b 100644 --- a/t/actions.t +++ b/t/actions.t @@ -9,7 +9,7 @@ use HTML::Zoom::FilterStream; my $tmpl = < -
+
Bob Builder
@@ -55,6 +55,14 @@ is( 'set attribute on existing attribute' ); +($expect = $tmpl) =~ s/name="cow" class="main"/name="bar" class="foo"/; + +is( + run_for { $_->set_attribute({ 'class' => 'foo', 'name' => 'bar'}) }, + $expect, + 'set attributes using hashref form' +); + ($expect = $tmpl) =~ s/class="main"/class="main" foo="bar"/; is( @@ -207,7 +215,7 @@ is( is( HTML::Zoom::Producer::BuiltIn->html_from_events(\@ev), - '
+ '
Bob Builder
@@ -220,7 +228,7 @@ is( is( run_for { $_->collect({ into => \@ev, content => 1 }) }, ' -
+
', 'collect w/content removes correctly' @@ -239,7 +247,7 @@ is( is( run_for { $_->replace($ohai, { content => 1 }) }, ' -
O HAI
+
O HAI
', 'replace w/content' @@ -273,11 +281,11 @@ is( ) }, q{ -
+
mst Chainsaw Wielder
-
+
mdk Adminion
@@ -305,7 +313,7 @@ is( ) }, q{ -
+
mst Chainsaw Wielder
@@ -345,7 +353,7 @@ is( ) }, q{ -
+
mst Chainsaw Wielder
@@ -378,7 +386,7 @@ is( ) }, q{ -
+
mst Chainsaw Wielder