Commit | Line | Data |
---|---|---|
4dd974da | 1 | # For testing Test::Simple; |
3c4bf434 | 2 | # $Id$ |
d020a79a | 3 | package Test::Simple::Catch; |
4dd974da | 4 | |
33459055 | 5 | use Symbol; |
30e302f8 | 6 | use TieOut; |
717da8a4 | 7 | my( $out_fh, $err_fh ) = ( gensym, gensym ); |
30e302f8 | 8 | my $out = tie *$out_fh, 'TieOut'; |
9 | my $err = tie *$err_fh, 'TieOut'; | |
4dd974da | 10 | |
33459055 | 11 | use Test::Builder; |
12 | my $t = Test::Builder->new; | |
13 | $t->output($out_fh); | |
14 | $t->failure_output($err_fh); | |
15 | $t->todo_output($err_fh); | |
4dd974da | 16 | |
717da8a4 | 17 | sub caught { return( $out, $err ) } |
4dd974da | 18 | |
4dd974da | 19 | 1; |