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/watch_filter_rubylang.t | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 't/watch_filter_rubylang.t') diff --git a/t/watch_filter_rubylang.t b/t/watch_filter_rubylang.t index 0ea680ee..72895d85 100644 --- a/t/watch_filter_rubylang.t +++ b/t/watch_filter_rubylang.t @@ -6,12 +6,7 @@ use PublicInbox::TestCommon; use Test::More; use PublicInbox::MIME; use PublicInbox::Config; -my @mods = qw(Filesys::Notify::Simple DBD::SQLite Search::Xapian); -foreach my $mod (@mods) { - eval "require $mod"; - plan skip_all => "$mod missing for watch_filter_rubylang_v2.t" if $@; -} - +require_mods(qw(Filesys::Notify::Simple DBD::SQLite Search::Xapian)); use_ok 'PublicInbox::WatchMaildir'; use_ok 'PublicInbox::Emergency'; my ($tmpdir, $for_destroy) = tmpdir(); -- cgit v1.2.3-24-ge0c7