Permalink
Browse files

Test #1

  • Loading branch information...
sergot committed Apr 14, 2012
1 parent c8d240c commit da0457676a141fa3885d0906af92b6295dc8f054
Showing with 8 additions and 11 deletions.
  1. +8 −11 t/t0.p6
View
19 t/t0.p6
@@ -1,18 +1,15 @@
use v6;
use Test;
-plan 1;
+plan 2;
use Term::ProgressBar;
+use IO::Capture::Simple;
-my $bar = Term::ProgressBar.new(count => 100, :p);
-my $r = ' ';
+my $bar = Term::ProgressBar.new(count => 100);
+my $r;
-$*OUT = class {
- method print(*@args) {
- $r ~= @args.join;
- }
-}
+$r = capture_stdout { $bar.update(50) }
+ok($r ~~ m/'[''='+' '+']'/);
-$bar.update(100);
-
-is $r, /100\%/;
+$r = capture_stdout { $bar.update(100) }
+ok($r ~~ m/'[''='+']'/);

0 comments on commit da04576

Please sign in to comment.