aboutsummaryrefslogtreecommitdiff
path: root/t/05-upgrade.t
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-06-13 00:24:11 +0200
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-06-13 00:24:11 +0200
commit7c2643cd319c9dd1d7caa6a8cc6831d8aa1e9c6e (patch)
tree6a62a5943e5941432490bc2830b0587fff28d259 /t/05-upgrade.t
parentf9252d36627e347fbe5523a8778b3cfd29a92bfd (diff)
downloadsbotools2-7c2643cd319c9dd1d7caa6a8cc6831d8aa1e9c6e.tar.xz
05-upgrade.t: add test for sboupgrade --all when nothing needs updating
Diffstat (limited to 't/05-upgrade.t')
-rwxr-xr-xt/05-upgrade.t15
1 files changed, 12 insertions, 3 deletions
diff --git a/t/05-upgrade.t b/t/05-upgrade.t
index aaf2451..53a4210 100755
--- a/t/05-upgrade.t
+++ b/t/05-upgrade.t
@@ -7,10 +7,11 @@ use Test::More;
use Capture::Tiny qw/ capture_merged /;
use FindBin '$RealBin';
use lib $RealBin;
-use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboconfig sboinstall sboupgrade restore_perf_dummy /;
+use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboconfig sboinstall sboupgrade restore_perf_dummy set_repo sbosnap /;
+use File::Temp 'tempdir';
if ($ENV{TEST_INSTALL}) {
- plan tests => 14;
+ plan tests => 15;
} else {
plan skip_all => 'Only run these tests if TEST_INSTALL=1';
}
@@ -100,12 +101,20 @@ sboupgrade 'nonexistentslackbuild4', { input => "y\ny", expected => qr/Proceed w
install( 'LO3', 'nonexistentslackbuild5', 'nonexistentslackbuild4' );
sboupgrade qw/ -f nonexistentslackbuild4 /, { input => "y\ny\ny", expected => qr/Proceed with nonexistentslackbuild5\b.*Proceed with nonexistentslackbuild4\b.*Upgrade queue: nonexistentslackbuild5 nonexistentslackbuild4\n/s };
-# 13-14: sboupgrade --all
+# 13-15: sboupgrade --all
+my $temp = tempdir(CLEANUP => 1);
+set_repo("file://$temp");
+capture_merged { system <<"END"; };
+cd $temp; git init;
+END
+sbosnap 'fetch', { test => 0 };
install( 'LO2', 'nonexistentslackbuild' );
my @sbos = glob("/var/log/packages/*_SBo");
sboupgrade '--all', { input => ("n\n" x (@sbos+1)), expected => qr/Proceed with nonexistentslackbuild\b/ };
install( 'LO2', 'nonexistentslackbuild', 'nonexistentslackbuild5', 'nonexistentslackbuild4' );
sboupgrade '--all', { input => ("n\n" x (@sbos+3)), expected => qr/Proceed with nonexistentslackbuild\b.*Proceed with nonexistentslackbuild5\b.*Proceed with nonexistentslackbuild4\b/s };
+set_lo("$RealBin/LO");
+sboupgrade '--all', { expected => "Checking for updated SlackBuilds...\nNothing to update.\n" };
# Cleanup
END {