aboutsummaryrefslogtreecommitdiff
path: root/t/10-version.t
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-02-12 19:10:55 +0100
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-02-13 00:44:55 +0100
commitbc109c4e73fb98b27b552cac67b438ca0b0f273c (patch)
tree669cfbcfcac144159320a46ccf2380e5e5148363 /t/10-version.t
parent49399cd278ba1ff469237caada226c2865460c2f (diff)
downloadsbotools2-bc109c4e73fb98b27b552cac67b438ca0b0f273c.tar.xz
Test -v output of all commands. This closes #33
Diffstat (limited to 't/10-version.t')
-rwxr-xr-xt/10-version.t50
1 files changed, 50 insertions, 0 deletions
diff --git a/t/10-version.t b/t/10-version.t
new file mode 100755
index 0000000..01299e1
--- /dev/null
+++ b/t/10-version.t
@@ -0,0 +1,50 @@
+#!/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::Execute;
+use SBO::Lib;
+
+plan tests => 8;
+
+$path = "$RealBin/../";
+
+sub make_slackbuilds_txt {
+ state $made = 0;
+ my $fname = "/usr/sbo/repo/SLACKBUILDS.TXT";
+ if ($_[0]) {
+ if ($made) { return system(qw!rm -rf!, $fname); }
+ } else {
+ if (not -e $fname) { $made = 1; system('mkdir', '-p', '/usr/sbo/repo'); system('touch', $fname); }
+ }
+}
+
+make_slackbuilds_txt();
+
+my $version = $SBO::Lib::VERSION;
+my $ver_text = <<"VERSION";
+sbotools version $version
+licensed under the WTFPL
+<http://sam.zoy.org/wtfpl/COPYING>
+VERSION
+
+# 1-8: test -v output of sbo* scripts
+script (qw/ sbocheck -v /, { expected => $ver_text });
+script (qw/ sboclean -v /, { expected => $ver_text });
+script (qw/ sboconfig -v /, { expected => $ver_text });
+script (qw/ sbofind -v /, { expected => $ver_text });
+script (qw/ sboinstall -v /, { expected => $ver_text });
+script (qw/ sboremove -v /, { expected => $ver_text });
+script (qw/ sbosnap -v /, { expected => $ver_text });
+script (qw/ sboupgrade -v /, { expected => $ver_text });
+
+# Cleanup
+END {
+ make_slackbuilds_txt('delete');
+}