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;
|