NAME
Test::PAUSE::Permissions - tests module permissions in your distribution
SYNOPSIS
# in your xt/perms.t
use Test::PAUSE::Permissions;
all_permissions_ok();
DESCRIPTION
This module is to test if modules in your distribution have proper permissions or not. You need to set RELEASE_TESTING to test this.
If your distribution has modules/packages that should not be indexed, you might want to generate META files before you run this test to provide no_index
information to Test::PAUSE::Permissions.
You might also want to prepare .pause
file to show who is releasing the distribution (you should have one to release distributions anyway).
FUNCTION
This module exports only one function (yet):
all_permissions_ok
Looks for packages with Parse::LocalDistribution, and tests if you have proper permissions for them by PAUSE::Permissions, which downloads 06perms.txt
from CPAN before testing.
By default, all_permissions_ok
looks into .pause
file to find who is releasing the distribution.
You can also pass the author as an argument, though this is only useful when you generate this test every time you release a distribution.
use Test::PAUSE::Permissions;
# assumes ISHIGAKI is going to release the distribution
all_permissions_ok('ISHIGAKI');
all_permissions_ok
also looks into META files for <x_authority>, and each .pm file for $AUTHORITY
variable, for your information.
You can pass an optional hash reference to all_permissions_ok()
to change its behavior.
strict mode
all_permissions_ok({strict => 1});
If this is set, all_permissions_ok
would fail if the following conditions should be met:
In the case above, if the uploader uploads the distribution, permission to the new package is only given to the uploader (and the author specified in x_authority
if applicable), and other maintainers will not be able to upload the distribution appropriately until they are given permission to the new package. Strict mode is to prevent such an (accidental) addtion so that everyone in a team can upload without a problem.
test also modules with a developer version
all_permissions_ok({dev => 1});
This module ignores modules that won't be indexed (namely those that have a version number with an underscore in it) by default. If you do want to test them, set dev
to true.
use MetaCPAN API for testing permissions
all_permissions_ok({metacpan => 1});
If metacpan
is true, this module tests permissions via MetaCPAN API instead of 06perms.txt
using PAUSE::Permissions::MetaCPAN. You can also set an environment variable TEST_PAUSE_PERMISSIONS_METACPAN
true to use MetaCPAN API.
SEE ALSO
PAUSE::Permissions, App::PAUSE::CheckPerms
AUTHOR
Kenichi Ishigaki, <ishigaki@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2014 by Kenichi Ishigaki.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.