X-Git-Url: https://git.donarmstrong.com/?p=term-progressbar.git;a=blobdiff_plain;f=t%2Fzero.t;h=ffabda91e980f4a98ac924043c7f8a73799a81d0;hp=8e6426b978648577ad1c0bb62ff62ee895a211bf;hb=14647cabb5bbb54629de8545e080519bd0be430f;hpb=8f87af0520c5dbcedbfe74dd6ef6e7826f200263 diff --git a/t/zero.t b/t/zero.t index 8e6426b..ffabda9 100644 --- a/t/zero.t +++ b/t/zero.t @@ -9,14 +9,11 @@ This package tests the zero-progress handling of progress bar. =cut use Data::Dumper qw( Dumper ); -use FindBin qw( $Bin ); use Test::More tests => 9; +use Test::Exception; use Capture::Tiny qw(capture); -use lib $Bin; -use test qw( evcheck ); - use_ok 'Term::ProgressBar'; Term::ProgressBar->__force_term (50); @@ -40,11 +37,8 @@ Update it it from 1 to 10. my $name; my ($out, $err) = capture { $name = 'doing nothing'; - ok (evcheck(sub { $p = Term::ProgressBar->new($name, 0); }, - 'V1 mode ( 1)' ), - 'V1 mode ( 1)'); - ok (evcheck(sub { $p->update($_) for 1..10 },'V1 mode ( 2)'), - 'V1 mode ( 2)'); + lives_ok { $p = Term::ProgressBar->new($name, 0); } 'V1 mode ( 1)'; + lives_ok { $p->update($_) for 1..10 } 'V1 mode ( 2)'; }; print $out; my @lines = grep $_ ne '', split /\r/, $err; @@ -72,12 +66,8 @@ Update it it from 1 to 10. my $p; my $name = 'zero'; my ($out, $err) = capture { - ok (evcheck(sub { $p = Term::ProgressBar->new({ count => 0, - name => $name }); }, - 'V2 mode ( 1)' ), - 'V2 mode ( 1)'); - ok (evcheck(sub { $p->update($_) for 1..10 },'V2 mode ( 2)'), - 'V2 mode ( 2)'); + lives_ok { $p = Term::ProgressBar->new({ count => 0, name => $name }); } 'V2 mode ( 1)'; + lives_ok { $p->update($_) for 1..10 } 'V2 mode ( 2)'; }; print $out; my @lines = grep $_ ne '', split /\r/, $err;