From 6bdb88770f849c47b5c09e733ac460ce3e9dbc97 Mon Sep 17 00:00:00 2001 From: Chad Granum Date: Fri, 15 Aug 2014 08:40:10 -0700 Subject: Update to include latest Test::Builder alpha Also updated some tests that the new builder broke --- cpan/Test-Simple/t/Builder/reset_outputs.t | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 cpan/Test-Simple/t/Builder/reset_outputs.t (limited to 'cpan/Test-Simple/t/Builder/reset_outputs.t') 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"; + } +} -- cgit v1.2.1