diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-04-21 01:49:25 +0200 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-04-21 01:49:25 +0200 |
commit | 6e84ae78bc34a7e02ea5f0f8a63b8dac22097877 (patch) | |
tree | d51af45ce2d71843ef9dfe485a4cd0128dad0109 | |
parent | 121c4fd0aec74f211987601be235d3491987dafd (diff) | |
download | sbotools2-6e84ae78bc34a7e02ea5f0f8a63b8dac22097877.tar.xz |
t/10-version.t: rewrite to use Test::Sbotools
-rwxr-xr-x | t/10-version.t | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/t/10-version.t b/t/10-version.t index 01299e1..6c2c8d5 100755 --- a/t/10-version.t +++ b/t/10-version.t @@ -8,23 +8,11 @@ use Capture::Tiny qw/ capture_merged /; use FindBin '$RealBin'; use lib $RealBin; use lib "$RealBin/../SBO-Lib/lib"; -use Test::Execute; +use Test::Sbotools qw/ make_slackbuilds_txt sbocheck sboclean sboconfig sbofind sboinstall sboremove sbosnap sboupgrade /; 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; @@ -35,16 +23,12 @@ licensed under the WTFPL 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 }); +sbocheck '-v', { expected => $ver_text }; +sboclean '-v', { expected => $ver_text }; +sboconfig '-v', { expected => $ver_text }; +sbofind '-v', { expected => $ver_text }; +sboinstall '-v', { expected => $ver_text }; +sboremove '-v', { expected => $ver_text }; +sbosnap '-v', { expected => $ver_text }; +sboupgrade '-v', { expected => $ver_text }; -# Cleanup -END { - make_slackbuilds_txt('delete'); -} |