1 # For testing Test::Simple;
2 package Test::Simple::Catch;
5 my($out_fh, $err_fh) = (gensym, gensym);
6 my $out = tie *$out_fh, __PACKAGE__;
7 my $err = tie *$err_fh, __PACKAGE__;
10 my $t = Test::Builder->new;
12 $t->failure_output($err_fh);
13 $t->todo_output($err_fh);
15 sub caught { return($out, $err) }
19 $$self .= join '', @_;
25 return bless \$self, $class;