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