diff options
author | Chad Granum <chad.granum@dreamhost.com> | 2014-08-15 08:40:10 -0700 |
---|---|---|
committer | James E Keenan <jkeenan@cpan.org> | 2014-08-16 23:19:29 +0200 |
commit | 6bdb88770f849c47b5c09e733ac460ce3e9dbc97 (patch) | |
tree | 3eda7f11aea1019f7a802c1caecfb81ab26e7761 /cpan/Test-Simple/t/Builder/reset_outputs.t | |
parent | 7d16fb5f4895e672484c0b7490722d46df82b099 (diff) | |
download | perl-6bdb88770f849c47b5c09e733ac460ce3e9dbc97.tar.gz |
Update to include latest Test::Builder alpha
Also updated some tests that the new builder broke
Diffstat (limited to 'cpan/Test-Simple/t/Builder/reset_outputs.t')
-rw-r--r-- | cpan/Test-Simple/t/Builder/reset_outputs.t | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/cpan/Test-Simple/t/Builder/reset_outputs.t b/cpan/Test-Simple/t/Builder/reset_outputs.t new file mode 100644 index 0000000000..b199128ad3 --- /dev/null +++ b/cpan/Test-Simple/t/Builder/reset_outputs.t @@ -0,0 +1,35 @@ +#!perl -w + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't'; + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; + } +} + +use Test::Builder; +use Test::More 'no_plan'; + +{ + my $tb = Test::Builder->create(); + + # Store the original output filehandles and change them all. + my %original_outputs; + + open my $fh, ">", "dummy_file.tmp"; + END { 1 while unlink "dummy_file.tmp"; } + for my $method (qw(output failure_output todo_output)) { + $original_outputs{$method} = $tb->$method(); + $tb->$method($fh); + is $tb->$method(), $fh; + } + + $tb->reset_outputs; + + for my $method (qw(output failure_output todo_output)) { + is $tb->$method(), $original_outputs{$method}, "reset_outputs() resets $method"; + } +} |