commit 810c0c0d89aa57dbab6c56bbd8d8d95e31b6280e
parent 1f66aa2686879dd96abeb51845387043dd0c307c
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date: Tue, 13 Sep 2016 11:09:32 +0200
25-unit-sbofind.t: use Test::Sbotools's load()
Diffstat:
1 file changed, 2 insertions(+), 18 deletions(-)
diff --git a/t/25-unit-sbofind.t b/t/25-unit-sbofind.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 => 6;
-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-6: sbofind unit tests...
{
load('sbofind');