From 13c3c3ffef691cfc461e88ac9a9e6cef65a15a8f Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Mon, 6 Dec 2004 19:37:34 +0000 Subject: [PATCH] Test::MockObject isn't a dependency, add helper for dynamic prereq_pm (which may come later) git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@300 48953598-375a-da11-a14b-00016c27c3ee --- Makefile.PL | 10 ++++++++-- t/apache_mvc.t | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 1740dd5..c623c12 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -23,8 +23,7 @@ WriteMakefile( CGI::Simple => 0, Template => 0, Template::Plugin::Class => 0, - Test::MockModule => 0, - Test::MockObject => 0, + Test::MockModule => 0, }, # e.g., Module::Name => 1.1 ( $] >= 5.005 @@ -37,6 +36,13 @@ WriteMakefile( ), ); +sub has_module { + my ($module, $version) = @_; + (my $file = "$module.pm") =~ s/::/\//g; + eval {require $file} or return; + return ($module->VERSION || 0) >= $version; +} + if ( !-e "t/beerdb.db" ) { print "Making SQLite DB\n"; eval { require DBD::SQLite }; diff --git a/t/apache_mvc.t b/t/apache_mvc.t index 4bb7185..e656128 100644 --- a/t/apache_mvc.t +++ b/t/apache_mvc.t @@ -1,7 +1,6 @@ #!/usr/bin/perl -w use strict; use Test::More tests => 10; -use Test::MockObject; require_ok('Apache::MVC'); ok($Apache::MVC::VERSION, 'defines $VERSION'); -- 2.39.2