From 1f66aa2686879dd96abeb51845387043dd0c307c Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Mon, 12 Sep 2016 19:20:01 +0200 Subject: 24-unit-sboconfig.t: use Test::Sbotools's load() --- t/24-unit-sboconfig.t | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 't') diff --git a/t/24-unit-sboconfig.t b/t/24-unit-sboconfig.t index 7f97827..ad74469 100755 --- a/t/24-unit-sboconfig.t +++ b/t/24-unit-sboconfig.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 => 2; -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-2: sboconfig unit tests... { load('sboconfig'); -- cgit v1.2.3