summaryrefslogtreecommitdiff
path: root/test/50-apt-why.t
diff options
context:
space:
mode:
Diffstat (limited to 'test/50-apt-why.t')
-rwxr-xr-xtest/50-apt-why.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/50-apt-why.t b/test/50-apt-why.t
new file mode 100755
index 0000000..2e2b934
--- /dev/null
+++ b/test/50-apt-why.t
@@ -0,0 +1,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");