diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-04-18 00:01:59 +0200 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-04-18 00:01:59 +0200 |
commit | f53f954f9ba98e062c79ec11fecdd4db772c0c29 (patch) | |
tree | 27c6f2af8776c52f4e8d3008aa87c4440d5f349b | |
parent | 3591a89dbc5229de9659cbb8626ee82ca34c089b (diff) | |
download | sbotools2-f53f954f9ba98e062c79ec11fecdd4db772c0c29.tar.xz |
Test sbosnap erroneous arguments
-rwxr-xr-x | t/18-snap.t | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/t/18-snap.t b/t/18-snap.t new file mode 100755 index 0000000..cb01196 --- /dev/null +++ b/t/18-snap.t @@ -0,0 +1,37 @@ +#!/usr/bin/env perl + +use 5.16.0; +use strict; +use warnings FATAL => 'all'; +use Test::More; +use Capture::Tiny qw/ capture_merged /; +use FindBin '$RealBin'; +use lib $RealBin; +use lib "$RealBin/../SBO-Lib/lib"; +use Test::Sbotools qw/ sbosnap /; +use SBO::Lib 'open_fh'; + +plan tests => 2; + +my $usage = <<'SBOSNAP'; +Usage: sbosnap [options|command] + +Options: + -h|--help: + this screen. + -v|--version: + version information. + +Commands: + fetch: initialize a local copy of the slackbuilds.org tree. + update: update an existing local copy of the slackbuilds.org tree. + (generally, you may prefer "sbocheck" over "sbosnap update") + +SBOSNAP + +# 1: sbosnap errors without arguments +sbosnap { exit => 1, expected => $usage }; + +# 2: sbosnap invalid errors +sbosnap 'invalid', { exit => 1, expected => $usage }; + |