1use strict;
2use warnings;
3use utf8;
4use Test::More;
5use lib "t/lib";
6use Util;
7
8package Minilla::Profile::EUMM;
9use parent qw(Minilla::Profile::Default);
10
11use Test::More;
12
13plan skip_all => "No git configuration" unless `git config user.email` =~ /\@/;
14
15use File::Temp qw(tempdir);
16use File::pushd;
17use Data::Section::Simple qw(get_data_section);
18use File::Basename qw(dirname);
19use File::Path qw(mkpath);
20
21use Minilla::Util qw(spew cmd slurp);
22use Minilla::Migrate;
23use Minilla::Git;
24
25subtest 'Removing committed README' => sub {
26    my $guard = pushd(tempdir());
27
28    my $profile = Minilla::Profile::EUMM->new(
29        author => 'foo',
30        dist => 'Acme-Foo',
31        path => 'Acme/Foo.pm',
32        suffix => 'Foo',
33        module => 'Acme::Foo',
34        version => '0.01',
35        email => 'foo@example.com',
36    );
37    $profile->generate();
38    $profile->render('minil.toml');
39    $profile->render('Makefile.PL');
40    $profile->render('MANIFEST');
41    unlink 'Build.PL';
42    unlink 'META.json';
43    unlink 'cpanfile';
44
45    git_init();
46    git_add();
47    git_commit('-m', 'initial import');
48
49    Minilla::Migrate->new->run();
50
51    like(slurp('.gitignore'), qr{!LICENSE});
52
53    ok -f 'META.json';
54};
55
56done_testing;
57
58__DATA__
59
60@@ minil.toml
61name = "Acme-Foo"
62
63@@ MANIFEST
64Makefile.PL
65minil.toml
66lib/Acme/Foo.pm
67cpanfile
68
69@@ Makefile.PL
70require 5.008001;
71use strict;
72use ExtUtils::MakeMaker;
73
74WriteMakefile(
75    NAME => 'Acme::Foo',
76    VERSION_FROM => 'lib/Acme/Foo.pm',
77    ABSTRACT => 'Acme style messages',
78    AUTHOR => 'Ghha',
79    LICENSE => "perl",
80    MIN_PERL_VERSION => 5.008001,
81    PREREQ_PM => {
82    },
83);
84