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/replace.t | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 't/replace.t') diff --git a/t/replace.t b/t/replace.t index 2346c3a1..085b49ee 100644 --- a/t/replace.t +++ b/t/replace.t @@ -8,11 +8,7 @@ use PublicInbox::InboxWritable; use PublicInbox::TestCommon; use Cwd qw(abs_path); require_git(2.6); # replace is v2 only, for now... -foreach my $mod (qw(DBD::SQLite)) { - eval "require $mod"; - plan skip_all => "$mod missing for $0" if $@; -} - +require_mods(qw(DBD::SQLite)); local $ENV{HOME} = abs_path('t'); sub test_replace ($$$) { -- cgit v1.2.3-24-ge0c7