Define required programs and modules at top for easy spotting.
authorAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>
Sun, 22 Jan 2012 16:07:58 +0000 (11:07 -0500)
committerAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>
Sun, 22 Jan 2012 16:07:58 +0000 (11:07 -0500)
t/cvs.t

diff --git a/t/cvs.t b/t/cvs.t
index 390e9af474624f85a2c8f0fdebb905fc2363550a..bb6e3e90ac6f44d4801d2ba2a2dc3e87ab7aae95 100755 (executable)
--- a/t/cvs.t
+++ b/t/cvs.t
@@ -5,6 +5,17 @@ use Test::More; my $total_tests = 9;
 use IkiWiki;
 
 my $default_test_methods = '^test_*';
+my @required_programs = qw(
+       cvs
+       cvsps
+);
+my @required_modules = qw(
+       File::chdir
+       File::MimeInfo
+       Date::Parse
+       File::Temp
+       File::ReadBackwards
+);
 my $dir = "/tmp/ikiwiki-test-cvs.$$";
 
 # TESTS FOR GENERAL META-BEHAVIOR
@@ -336,23 +347,14 @@ main();
 sub _plan_for_test_more {
        my $can_plan = shift;
 
-       foreach my $program (qw(
-               cvs
-               cvsps
-       )) {
+       foreach my $program (@required_programs) {
                my $program_path = `which $program`;
                chomp $program_path;
                return plan(skip_all => "$program not available")
                        unless -x $program_path;
        }
 
-       foreach my $module (qw(
-               File::chdir
-               File::MimeInfo
-               Date::Parse
-               File::Temp
-               File::ReadBackwards
-       )) {
+       foreach my $module (@required_modules) {
                eval qq{use $module};
                return plan(skip_all => "$module not available")
                        if $@;