File: withblib.t

package info (click to toggle)
libdist-zilla-plugin-checkextratests-perl 0.029-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 260 kB
  • sloc: perl: 598; makefile: 2
file content (44 lines) | stat: -rw-r--r-- 867 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
35
36
37
38
39
40
41
42
43
44
#!perl

use strict;
use warnings;
use lib 't/lib';

use Capture::Tiny qw/capture/;
use Dist::Zilla::App::Tester;
use Test::DZil;
use Test::Requires { 'Dist::Zilla::Tester' => 4.300017 };
use Test::More 0.88;
use Try::Tiny;

## XT FILE GUTS
my $xt_file = << 'HERE';
use Test::More tests => 1;
use Foo;
is(Foo::foo(), 456);
HERE

## Tests start here

{
    my $tzil = Dist::Zilla::Tester->from_config(
        { dist_root => 'corpus/WithBlib' },
        { add_files => { 'source/xt/checkme.t' => $xt_file, }, },
    );
    ok( $tzil, "created test dist that depends on the 'make' step" );

    capture { $tzil->release };

    ok(
        !grep( {/Fatal errors in xt/i} @{ $tzil->log_messages } ),
        "No xt errors logged",
    );
    ok(
        grep( {/fake release happen/i} @{ $tzil->log_messages } ),
        "FakeRelease executed",
    );

}

done_testing;