-use Capture::Tiny qw(capture);
-
-my ($out, $err) = capture {
- my $p;
- ok (evcheck(sub { $p = Term::ProgressBar->new('bob', 10); },
- 'Count 1-10 (1)' ),
- 'Count 1-10 (1)');
- ok (evcheck(sub { $p->update($_) for 1..5 }, 'Count 1-10 (2)' ),
- 'Count 1-10 (2)');
- ok (evcheck(sub { $p->message(MESSAGE1) }, 'Count 1-10 (3)' ),
- 'Count 1-10 (3)');
- ok (evcheck(sub { $p->update($_) for 6..10 }, 'Count 1-10 (4)' ),
- 'Count 1-10 (4)');
-};
-print $out;
+
+{
+ 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)';
+ };