X-Git-Url: https://git.donarmstrong.com/?p=term-progressbar.git;a=blobdiff_plain;f=t%2Fv1-message.t;h=9a95824b9554c18bf56bb0ca03d0fa9824b15bd1;hp=3428ff808f2ddff6ea1aeeed2ee7830027f28c9e;hb=c3f8be419c0674c8a6fdb64bddd841a0957adf28;hpb=9d9b1d8162c51d1933dd8cfc5c440889d0326d2a diff --git a/t/v1-message.t b/t/v1-message.t index 3428ff8..9a95824 100644 --- a/t/v1-message.t +++ b/t/v1-message.t @@ -12,7 +12,7 @@ This package tests the basic functionality of Term::ProgressBar. use Test::More tests => 8; use Test::Exception; -use Capture::Tiny qw(capture); +use Capture::Tiny qw(capture_stderr); my $MESSAGE1 = 'Walking on the Milky Way'; @@ -39,14 +39,13 @@ Update it it from 1 to 10. =cut { - my ($out, $err) = capture { + my $err = capture_stderr { my $p; lives_ok { $p = Term::ProgressBar->new('bob', 10); } 'Count 1-10 (1)'; lives_ok { $p->update($_) for 1..5 } 'Count 1-10 (2)'; lives_ok { $p->message($MESSAGE1) } 'Count 1-10 (3)'; lives_ok { $p->update($_) for 6..10 } 'Count 1-10 (4)'; }; - print $out; $err =~ s!^.*\r!!gm; diag "ERR:\n$err\nlength: ", length($err)