File: show.t

package info (click to toggle)
libcpan-audit-perl 20250829.001-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 336 kB
  • sloc: perl: 909; makefile: 8
file content (31 lines) | stat: -rw-r--r-- 763 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
use strict;
use warnings;
use lib 't/lib';
use Test::More;
use TestCommand;

subtest 'command: show' => sub {
    my ( $stdout, $stderr, $exit ) = TestCommand->command( 'show', 'CPANSA-Catalyst-Runtime-2013-01' );

    like $stdout, qr/CPANSA-Catalyst-Runtime-2013-01/;
    is $stderr,   '';
    is $exit,     0;
};

subtest 'command: show unknown advisory' => sub {
    my ( $stdout, $stderr, $exit ) = TestCommand->command( 'show', 'CPANSA-UNKNOWN' );

    is $stdout,   '';
    like $stderr, qr/Invalid advisory id/;
    isnt $exit,   0;
};

subtest 'command: show invalid invocation' => sub {
    my ( $stdout, $stderr, $exit ) = TestCommand->command('show');

    is $stdout,   '';
    like $stderr, qr/Error: Usage:/;
    isnt $exit,   0;
};

done_testing;