Fix ->repeat with iterator, make t/repeat.t pass (formerly t/todo-repeat.t)
[catagits/HTML-Zoom.git] / t / flush.t
index bf60b64..8b1aef9 100644 (file)
--- a/t/flush.t
+++ b/t/flush.t
@@ -2,21 +2,8 @@ use strict;
 use warnings FATAL => 'all';
 
 use HTML::Zoom;
-use HTML::Zoom::CodeStream;
-
 use Test::More;
 
-
-# turns iterator into stream
-sub code_stream (&) {
-  my $code = shift;
-  return sub {
-    HTML::Zoom::CodeStream->new({
-      code => $code,
-    });
-  }
-}
-
 my $tmpl = <<'TMPL';
 <body>
   <div class="item">
@@ -31,7 +18,7 @@ my @list = qw(foo bar baz);
 foreach my $flush (0..1) {
 
   # from HTML::Zoom manpage, slightly modified
-  my $z2 = $zoom->select('.item')->repeat(code_stream {
+  my $z2 = $zoom->select('.item')->repeat(sub {
     if (my $name = shift @list) {
       return sub { $_->select('.item-name')->replace_content($name) }
     } else {