File: fail.t

package info (click to toggle)
libtest-requires-git-perl 1.008-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 200 kB
  • sloc: perl: 297; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 656 bytes parent folder | download | duplicates (4)
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
use strict;
use warnings;
use Test::More;

use Test::Requires::Git -nocheck;

plan tests => 7;

ok( !eval { test_requires_git 'zlonk' }, 'odd specification' );
like(
    $@,
    qr/^zlonk does not look like a Git version /,
    '... expected error message'
);

ok( !eval { test_requires_git 'zlonk' => 'bam' }, 'bad specification' );
like(
    $@,
    qr/^Unknown git specification 'zlonk' /,
    '... expected error message'
);

ok( !eval { test_requires_git skip => 2, skip => 3 }, 'duplicate argument' );
like(
    $@,
    qr/^Duplicate 'skip' argument /,
    '... expected error message'
);

$ENV{PATH} = '';
test_requires_git;
fail( 'cannot happen');