X-Git-Url: https://git.donarmstrong.com/?p=term-progressbar.git;a=blobdiff_plain;f=t%2Fv2-simple.t;h=4816ab989ad012fad2015a1053989572f93cf676;hp=3bb54f784c4ee4c3b86b97f8724c74d79146cc9f;hb=14647cabb5bbb54629de8545e080519bd0be430f;hpb=8f87af0520c5dbcedbfe74dd6ef6e7826f200263 diff --git a/t/v2-simple.t b/t/v2-simple.t index 3bb54f7..4816ab9 100644 --- a/t/v2-simple.t +++ b/t/v2-simple.t @@ -9,11 +9,8 @@ This package tests the basic functionality of Term::ProgressBar. =cut use Data::Dumper qw( Dumper ); -use FindBin qw( $Bin ); use Test::More tests => 31; - -use lib $Bin; -use test qw( evcheck ); +use Test::Exception; use Capture::Tiny qw(capture); @@ -39,10 +36,8 @@ Update it it from 1 to 10. my $p; my ($out, $err) = capture { - ok (evcheck(sub { $p = Term::ProgressBar->new(10); }, 'Count 1-10 (1)' ), - 'Count 1-10 (1)'); - ok (evcheck(sub { $p->update($_) for 1..10 }, 'Count 1-10 (2)' ), - 'Count 1-10 (2)'); + lives_ok { $p = Term::ProgressBar->new(10); } 'Count 1-10 (1)'; + lives_ok { $p->update($_) for 1..10 } 'Count 1-10 (2)'; }; print $out; my @lines = grep $_ ne '', split /\r/, $err; @@ -72,10 +67,8 @@ Update it it from 1 to 9. my $p; my ($out, $err) = capture { - ok (evcheck(sub { $p = Term::ProgressBar->new(10); }, 'Count 1-9 (1)' ), - 'Count 1-9 (1)'); - ok (evcheck(sub { $p->update($_) for 1..9 }, 'Count 1-9 (2)' ), - 'Count 1-9 (2)'); + lives_ok { $p = Term::ProgressBar->new(10); } 'Count 1-9 (1)'; + lives_ok { $p->update($_) for 1..9 } 'Count 1-9 (2)'; }; print $out;