sbotools2

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

commit 9bb214765ad28de04d2869fd6513fc1649e122ff
parent 70a7508791aebd0cfa623ecdbd56e072629f799c
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date:   Sun, 11 Sep 2016 19:31:40 +0200

23-unit-sboclean.t: use Test::Sbotools's load()

Diffstat:
Mt/23-unit-sboclean.t | 20++------------------
1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/t/23-unit-sboclean.t b/t/23-unit-sboclean.t @@ -5,30 +5,14 @@ use warnings; use Test::More; use Test::Exit; use FindBin '$RealBin'; -use lib "$RealBin/../SBO-Lib/lib"; +use lib $RealBin; +use Test::Sbotools qw/ load /; use Capture::Tiny qw/ capture_merged /; use File::Temp 'tempdir'; use Cwd; plan tests => 4; -sub load { - my ($script, %opts) = @_; - - local @ARGV = exists $opts{argv} ? @{ $opts{argv} } : '-h'; - my ($ret, $exit, $out, $do_err); - my $eval = eval { - $out = capture_merged { $exit = exit_code { - $ret = do "$RealBin/../$script"; - $do_err = $@; - }; }; - 1; - }; - my $err = $@; - - note explain { ret => $ret, exit => $exit, out => $out, eval => $eval, err => $err, do_err => $do_err } if $opts{explain}; -} - # 1-4: sboclean unit tests... { load('sboclean');