aboutsummaryrefslogtreecommitdiffstats
path: root/t/tags.t
blob: 4946799cc5c4a408975e4a32308af2ae3bce1d26 (plain)
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
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/perl
# $Id: tags.t 1687 2007-06-28 22:44:07Z guillomovitch $

use Test::More tests => 3;
use Test::Exception;
use Youri::Package::RPM::Test;
use Youri::Submit::Test::Tag;

my $test = Youri::Submit::Test::Tag->new(
    tags => { release => 'plf$' },
    skip => [ 'bar' ]
);

lives_ok {
    $test->run(
        undef,
        undef,
        undef,
        [
            Youri::Package::RPM::Test->new(tags => {
                name    => 'foo',
                release => '1plf' 
            })
        ]
    )
} 'compliant package succeed';

throws_ok {
    $test->run(
        undef,
        undef,
        undef,
        [
            Youri::Package::RPM::Test->new(tags => {
                name    => 'foo',
                release => '1mdk' 
            })
        ]
    )
} qr/invalid value 1mdk for tag release/,
'non-compliant package fails';

lives_ok {
    $test->run(
        undef,
        undef,
        undef,
        [
            Youri::Package::RPM::Test->new(tags => {
                name    => 'bar',
                release => '1mdk'
            })
        ],
    )
} 'non-compliant package with exception succeed';