From: Simon Cozens Date: Mon, 6 Dec 2004 19:37:34 +0000 (+0000) Subject: Test::MockObject isn't a dependency, add helper for dynamic prereq_pm (which may... X-Git-Tag: 2.10~64 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=13c3c3ffef691cfc461e88ac9a9e6cef65a15a8f;p=maypole.git 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 --- 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');