Permalink
Browse files

Capturing STDOUT tests

  • Loading branch information...
sergot committed Apr 14, 2012
1 parent 8fbaef0 commit c1e29f49cb65b04eaa0e80962de0dfdb4827c1a7
Showing with 16 additions and 0 deletions.
  1. +16 −0 t/t0.p6
View
16 t/t0.p6
@@ -0,0 +1,16 @@
+use IO::Capture::Simple;
+use Test;
+plan 2;
+
+my $test = "OH HAI!";
+
+my $r = capture_stdout { print $test }
+
+ok $r ~~ $test;
+
+$r = '';
+
+capture_stdout($r);
+print $test;
+stdout_off;
+ok $r ~~ $test;

0 comments on commit c1e29f4

Please sign in to comment.