From f07ced343a40ec0f507f099e055fcd7f9c912c8b Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Wed, 4 May 2016 00:39:49 +0200 Subject: 18-snap.t: add test for update in an empty repo --- t/18-snap.t | 19 +++++++++++++++++-- 1 file 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[.][.][.]/ };; + -- cgit v1.2.3