From 01323f127ddaf8eb9bd9b9d9ea8bcd6a6fd8a49e Mon Sep 17 00:00:00 2001 From: Aaron Trevena Date: Mon, 2 Oct 2006 16:37:24 +0000 Subject: [PATCH] made db_colinfo test less fragile, changed test on @ISA to work with different ordering git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@525 48953598-375a-da11-a14b-00016c27c3ee --- Changes | 2 ++ lib/Maypole/View/Base.pm | 1 + lib/Maypole/View/TT.pm | 1 + t/01basics.t | 3 ++- t/db_colinfo.t | 7 ++++++- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 3ba29b6..ae9113a 100644 --- a/Changes +++ b/Changes @@ -6,7 +6,9 @@ For information about current developments and future releases, see: Fixed some db_colinfo test bugs Fixed typo in edit form template Now uses Class::C3 in all Classes to simplify inheritence + Inheritence simpler and nicer and less hacked add_model_superclass method moves @ISA munging into the model + new Class::DBI::DFV based model 2.11 Mon 31 July 2006 diff --git a/lib/Maypole/View/Base.pm b/lib/Maypole/View/Base.pm index 5a99580..277a0c9 100644 --- a/lib/Maypole/View/Base.pm +++ b/lib/Maypole/View/Base.pm @@ -1,4 +1,5 @@ package Maypole::View::Base; +use Class::C3; use File::Spec; use UNIVERSAL::moniker; use strict; diff --git a/lib/Maypole/View/TT.pm b/lib/Maypole/View/TT.pm index ac2aceb..3ab23be 100644 --- a/lib/Maypole/View/TT.pm +++ b/lib/Maypole/View/TT.pm @@ -1,4 +1,5 @@ package Maypole::View::TT; +use Class::C3; use base 'Maypole::View::Base'; use Maypole::Constants; use Template; diff --git a/t/01basics.t b/t/01basics.t index 8488985..6fa0c1e 100644 --- a/t/01basics.t +++ b/t/01basics.t @@ -48,4 +48,5 @@ is ($classdata{related_accessors},'pubs','classdata.related_accessors'); # test Maypole::load_custom_class() can_ok(BeerDB::Beer => 'fooey'); # defined in BeerDB::Beer can_ok(BeerDB::Beer => 'floob'); # defined in BeerDB::Base -is_deeply( [@BeerDB::Beer::ISA], [qw/Maypole::Model::CDBI Class::DBI::SQLite BeerDB::Base/] ); + +is_deeply( [@BeerDB::Beer::ISA], [qw/Class::DBI::SQLite Maypole::Model::CDBI BeerDB::Base/] ); diff --git a/t/db_colinfo.t b/t/db_colinfo.t index 50f885f..8f38f3b 100755 --- a/t/db_colinfo.t +++ b/t/db_colinfo.t @@ -4,7 +4,12 @@ use Data::Dumper; use DBI; use lib 'examples'; # Where BeerDB should live BEGIN { - my $drh = eval { DBI->install_driver("mysql"); }; + my $drh = eval { + DBI->install_driver("mysql"); + my @databases = DBI->data_sources("mysql"); + die "couldn't connect to mysql" unless (@databases); + }; + warn "error : $@ \n" if ($@); my $testcount = ($@) ? 45 : 65 ; plan tests => $testcount; } -- 2.39.5