sbotools2

Maintenance fork of the original sbotools version 2
Log | Files | Refs | README

commit f07ced343a40ec0f507f099e055fcd7f9c912c8b
parent e9227856cba2d163e75b0cc156ef9bd67d7ac422
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date:   Wed,  4 May 2016 00:39:49 +0200

18-snap.t: add test for update in an empty repo

Diffstat:
Mt/18-snap.t | 19+++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

diff --git 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[.][.][.]/ };; +