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/psgi_text.t | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 't/psgi_text.t') diff --git a/t/psgi_text.t b/t/psgi_text.t index ee4d9f14..757a1294 100644 --- a/t/psgi_text.t +++ b/t/psgi_text.t @@ -10,10 +10,7 @@ my $maindir = "$tmpdir/main.git"; my $addr = 'test-public@example.com'; my $cfgpfx = "publicinbox.test"; my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape); -foreach my $mod (@mods) { - eval "require $mod"; - plan skip_all => "$mod missing for psgi_text.t" if $@; -} +require_mods(@mods); use_ok $_ foreach @mods; use PublicInbox::Import; use PublicInbox::Git; -- cgit v1.2.3-24-ge0c7