X-Git-Url: https://git.donarmstrong.com/?p=term-progressbar.git;a=blobdiff_plain;f=t%2Fv2-mobile.t;h=342d06ffb11f52f7eec223735df3fe3316803957;hp=dd42ea3f0d52b476d890ecbde1873b35d37fe274;hb=c3f8be419c0674c8a6fdb64bddd841a0957adf28;hpb=9d9b1d8162c51d1933dd8cfc5c440889d0326d2a diff --git a/t/v2-mobile.t b/t/v2-mobile.t index dd42ea3..342d06f 100644 --- a/t/v2-mobile.t +++ b/t/v2-mobile.t @@ -12,7 +12,7 @@ This package tests the moving target functionality of Term::ProgressBar. use Test::More tests => 7; use Test::Exception; -use Capture::Tiny qw(capture); +use Capture::Tiny qw(capture_stderr); use_ok 'Term::ProgressBar'; @@ -36,14 +36,13 @@ Update it from 11 to 20. =cut -my ($out, $err) = capture { +my $err = capture_stderr { my $p; lives_ok { $p = Term::ProgressBar->new(10); } 'Count 1-20 (1)'; lives_ok { $p->update($_) for 1..5 } 'Count 1-20 (2)'; lives_ok { $p->target(20) } 'Count 1-20 (3)'; lives_ok { $p->update($_) for 11..20 } 'Count 1-20 (4)'; }; -print $out; $err =~ s!^.*\r!!gm; diag "ERR:\n$err\nlength: " . length($err)