From a09f678d8254064af7ca6dcfb3c3f84b5ae37b51 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 22 Dec 2019 22:17:37 +0000 Subject: testcommon: add require_mods method and use it This cuts down on lines of code in individual test cases and fixes some misnamed error messages by using "$0" consistently. This will also provide us with a method of swapping out dependencies which provide equivalent functionality (e.g "Xapian" SWIG can replace "Search::Xapian" XS bindings). --- t/purge.t | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 't/purge.t') diff --git a/t/purge.t b/t/purge.t index 0262f791..7f49bc60 100644 --- a/t/purge.t +++ b/t/purge.t @@ -5,11 +5,7 @@ use warnings; use Test::More; use PublicInbox::TestCommon; require_git(2.6); -my @mods = qw(DBI DBD::SQLite); -foreach my $mod (@mods) { - eval "require $mod"; - plan skip_all => "missing $mod for t/purge.t" if $@; -}; +require_mods(qw(DBD::SQLite)); use Cwd qw(abs_path); # we need this since we chdir below local $ENV{HOME} = abs_path('t'); my $purge = abs_path('blib/script/public-inbox-purge'); -- cgit v1.2.3-24-ge0c7