'transform_content works for one specific selected element',
);
+$expect = do {
+ # done in a new context to keep test namespace clean
+ my $copy_of_tmpl = $tmpl;
+ my $repeatable = +( $copy_of_tmpl =~ m{(<div\sclass="main".+?</div>)}xms )[0];
+ my $repeated = join q{}, map {
+ # don't modify the original one
+ my $item = $repeatable;
+ $item =~ s{(<span[^>]+>)}{$1$_. }xmsg;
+ $item
+ } 1 .. 2;
+ $copy_of_tmpl =~ s{<div.+?</div>}{$repeated}xms;
+ $copy_of_tmpl;
+};
+
+is(
+ ( run_for {
+ $_->repeat([
+ sub {
+ $_->select('span')->transform_content( sub { "1. $_" } );
+ },
+ sub {
+ $_->select('span')->transform_content( sub { "2. $_" } );
+ },
+ ]);
+ } 'div.main'
+ ),
+ $expect,
+ 'check if transform_content works for repeatables',
+ );
+
($expect = $tmpl) =~ s/(?=<div)/O HAI/;
my $ohai = [ { type => 'TEXT', raw => 'O HAI' } ];