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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
use strict;
use warnings;
use Test::More 0.88;
use File::pushd qw/pushd/;
use Dist::Zilla::Path;
use Test::DZil;
use Dist::Zilla::App::Tester;
use YAML::Tiny;
use Test::File::ShareDir -share => {
-module => { 'Dist::Zilla::MintingProfile::Default' => 'profiles' },
};
my $tzil = Minter->_new_from_profile(
[ Default => 'default' ],
{ name => 'DZT-Minty', },
{ global_config_root => 'corpus/global' },
);
$tzil->mint_dist;
my $pm = $tzil->slurp_file('mint/lib/DZT/Minty.pm');
like(
$pm,
qr/package DZT::Minty;/,
"our new module has the package declaration we want",
);
my $distini = $tzil->slurp_file('mint/dist.ini');
like(
$distini,
qr/copyright_holder = A. U. Thor/,
"copyright_holder in dist.ini",
);
{
my $result = test_dzil( $tzil->tempdir->child('mint')->absolute, [qw(add Foo::Bar)] );
ok(!$result->{exit_code}) || diag($result->{error});
my $pm = path($result->{tempdir})->child('source/lib/Foo/Bar.pm')->slurp;
like(
$pm,
qr/package Foo::Bar;/,
"our second module has the package declaration we want",
);
}
done_testing;
|