Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't try to open files in the distribution for writing #46

Merged
merged 1 commit into from Mar 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions t/truncate.t
Expand Up @@ -6,13 +6,12 @@ use File::Temp qw(tempfile);
use IO::Handle;
use File::Spec;
use FindBin qw($Bin);
use constant TRUNCATE_ME => File::Spec->catfile($Bin,'truncate_me');

my ($truncate_status, $tmpfh);
my ($truncate_status, $tmpfh, $tmpfile);

# Some systems have a screwy tempfile. We don't run our tests there.
eval {
$tmpfh = tempfile();
($tmpfh, $tmpfile) = tempfile();
};

if ($@ or !defined $tmpfh) {
Expand Down Expand Up @@ -80,7 +79,7 @@ isa_ok($@, 'autodie::exception', "Truncating unopened file (TRUNCATE_FH)");
# wrong with our tests, or autodie...
{
use autodie qw(open);
open(TRUNCATE_FH, '+<', TRUNCATE_ME);
open(TRUNCATE_FH, '+<', $tmpfile);
}

# Now try truncating the filehandle. This should succeed.
Expand Down
Empty file removed t/truncate_me
Empty file.