File: 03.create_distro_with_build.t

package info (click to toggle)
libmodule-starter-smart-perl 0.0.9-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 108 kB
  • sloc: perl: 224; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 750 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env perl

use strict;
use warnings;

use Test::More tests => 3;
use Test::TempDir::Tiny;
use Module::Starter qw/Module::Starter::Smart/;
use File::Spec;

my $tempdir = tempdir();
my $root = File::Spec->catdir($tempdir, 'Foo-Bar');

{
    local $SIG{__WARN__} = sub {
        warn $_[0] unless $_[0] =~ /^Added to MANIFEST/;
    };

    Module::Starter->create_distro(
        author  => 'me',
        builder  => 'Module::Build',
        modules  => ['Foo::Bar'],
        email    => 'me@there.com',
        dir      => $root,
    );
}

ok(-d $root, 'Module root exists');

my $file = File::Spec->catfile($root, qw(lib Foo Bar.pm));
ok(-f $file, 'Module file exists');

push @INC, File::Spec->catdir($root, 'lib');
require_ok('Foo::Bar');