aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-05-04 00:39:49 +0200
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-05-04 00:39:49 +0200
commitf07ced343a40ec0f507f099e055fcd7f9c912c8b (patch)
tree409653bed2925be4b3c1a6abac56ed17f2eb02d0 /t
parente9227856cba2d163e75b0cc156ef9bd67d7ac422 (diff)
downloadsbotools2-f07ced343a40ec0f507f099e055fcd7f9c912c8b.tar.xz
18-snap.t: add test for update in an empty repo
Diffstat (limited to 't')
-rwxr-xr-xt/18-snap.t19
1 files changed, 17 insertions, 2 deletions
diff --git a/t/18-snap.t b/t/18-snap.t
index d81c785..a355240 100755
--- a/t/18-snap.t
+++ b/t/18-snap.t
@@ -7,9 +7,10 @@ use Test::More;
use Capture::Tiny qw/ capture_merged /;
use FindBin '$RealBin';
use lib $RealBin;
-use Test::Sbotools qw/ sbosnap /;
+use Test::Sbotools qw/ sbosnap set_repo /;
+use File::Temp 'tempdir';
-plan tests => 2;
+plan tests => 3;
my $usage = <<'SBOSNAP';
Usage: sbosnap [options|command]
@@ -33,3 +34,17 @@ sbosnap { exit => 1, expected => $usage };
# 2: sbosnap invalid errors
sbosnap 'invalid', { exit => 1, expected => $usage };
+# 3: sbosnap update when /usr/sbo/repo is empty
+my $tmp = tempdir(CLEANUP => 1);
+set_repo("file://$tmp");
+capture_merged { system <<"END"; };
+cd $tmp
+git init
+mkdir test
+cp -a $RealBin/LO/nonexistentslackbuild test
+git add test
+git commit -m 'test'
+END
+
+sbosnap 'update', { expected => qr/Pulling SlackBuilds tree[.][.][.]/ };;
+