Test-Cmd

 view release on metacpan or  search on metacpan

t/writable.t  view on Meta::CPAN

ok(-w $test->curdir);
ok(-w 'file1');
ok(-w 'foo');
ok(-w $test->workpath('foo', 'file2'));

# Make sure we can call with the optional error-collecting hash.
# It would be good to check that this does, in fact, collect errors,
# but the only two ways I can think of to get chmod() to generate an
# error are a non-existent file (which won't happen because
# finddepth() only calls its routine for existing files) or a file
# owned by someone else.  We can't rely on being able to chown()
# a file unless we're root, though, and if we're root, the file will
# be writable because root can write to anything.  So just punt on
# this for now.
my %errs;
$ret = $test->writable($wdir, 0, \%errs);
ok($ret == 0);

skip($> == 0, ! -w $test->curdir);
skip($> == 0, ! -w 'file1');
skip($> == 0, ! -w 'foo');



( run in 0.523 second using v1.01-cache-2.11-cpan-5511b514fd6 )