Skip to content

Commit

Permalink
Add the ability to clear the debugging streamer.
Browse files Browse the repository at this point in the history
Useful for Test::Builder::Tester

For #242
  • Loading branch information
schwern committed Nov 30, 2011
1 parent 679d000 commit 29b3aef
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/TB2/Streamer/Debug.pm
Expand Up @@ -24,6 +24,14 @@ has read_all_position => (
default => 0,
);

sub clear {
my $self = shift;
@{$self->written_hunks()} = ();
%{$self->read_position_for} = ();
$self->read_all_position(0);
return;
}

sub write {
my ($self, $dest, @hunks) = @_;
push @{ $self->written_hunks }, [ $dest => join '', @hunks ];
Expand Down

0 comments on commit 29b3aef

Please sign in to comment.