Skip to content

Commit

Permalink
Don't let deliberate warning leak to user space
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovid committed Apr 30, 2013
1 parent c6d557e commit 6565414
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions t/arrayref_bug.t
Expand Up @@ -3,12 +3,10 @@ use lib 'lib';
use Code::CutNPaste;
use Test::Most;

{
no warnings qw/redefine once/;
*File::Temp::new = sub {
die("Could not create temp file: Permission denied");
}
}
my $error = 'Could not create temp file: Permission denied';
$SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /$error/ };
no warnings qw/redefine once/;
*File::Temp::new = sub { die($error); };

ok my $cutnpaste = Code::CutNPaste->new(
dirs => 't/fixtures',
Expand Down

0 comments on commit 6565414

Please sign in to comment.