summaryrefslogtreecommitdiff
path: root/test/50-apt-why.t
blob: 2e2b93448419901d6b80f29bc02623e3d0691a6b (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
#!/usr/bin/env perl
## Copyright © 2010 by Daniel Friesel <derf@derf.homelinux.org>
## License: WTFPL <http://sam.zoy.org/wtfpl>
use strict;
use warnings;
use 5.010;
use Test::Command tests => 6;

my $aw = 'bin/apt-why';

my $re_usage =
	qr{Usage: \S*apt-why \[options\] <package>; see \S*apt-why --help};

my $cmd = Test::Command->new(cmd => "$aw");

$cmd->exit_isnt_num(0);
$cmd->stdout_is_eq('');
$cmd->stderr_like($re_usage);

$cmd = Test::Command->new(cmd => "$aw does-not-exist");

$cmd->exit_isnt_num(0);
$cmd->stdout_is_eq('');
$cmd->stderr_is_eq("No such package: does-not-exist\n");