File: fatal.t

package info (click to toggle)
libdist-zilla-plugin-requiresexternal-perl 1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 220 kB
  • ctags: 6
  • sloc: perl: 712; makefile: 2
file content (32 lines) | stat: -rwxr-xr-x 822 bytes parent folder | download
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
#!perl

use Modern::Perl;
use English '-no_match_vars';
use Test::Most tests => 3;
use Test::DZil;

my $tzil = Builder->from_config(
    { dist_root => 1 },
    {   add_files => {
            'source/dist.ini' => simple_ini(
                ['@Basic'],
                [   RequiresExternal => {
                        fatal    => 1,
                        requires => ['this_is_supposed_to_fail'],
                    },
                ],
            ),
            'source/lib/DZT/Sample.pm' => <<'END_SAMPLE_PM',
package DZT::Sample;
# ABSTRACT: Sample package
1;
END_SAMPLE_PM
        },
    },
);

lives_ok( sub { $tzil->build() }, 'build' );
ok( ( grep { $ARG->name eq 't/000-requires_external.t' } @{ $tzil->files } ),
    'test script added'
);
dies_ok( sub { $tzil->run_tests_in( $tzil->built_in ) }, 'test' );