1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
# vim600: set syn=perl :
use Test::More tests => 4;
BEGIN { use_ok('IO::Capture::Stderr') };
# These will generate some warnings -> preventing from printing
#open STDERR_SAV, ">&STDERR"
open STDERR, ">/dev/null";
#Test 2
# Now test creating two captures of the same type and starting both
my $capture1 = IO::Capture::Stderr->new();
my $capture2 = IO::Capture::Stderr->new();
my $rv1 = $capture1->start();
ok(!$capture2->start(), "Two captures");
$capture2->stop();
ok(!$capture1->start(), "Two starts");
ok(!$capture1->read(), "Read before stop");
# restore STDERR
#close STDERR; open STDERR, ">&STDERR_SAV"; close STDERR_SAV;
|