From: Peter Rabbitson Date: Wed, 25 Jan 2012 10:17:13 +0000 (+0100) Subject: Warn-free test suite with later DBIC X-Git-Tag: v0.001006~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f3b5161e466df2a94f2704177f0173e7d940c4d5;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git Warn-free test suite with later DBIC --- diff --git a/Changes b/Changes index 89fe020..8416d28 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,8 @@ Revision history for {{$dist->name}} {{$NEXT}} - - Stop deleting the wrong version + - Stop warning all the time (ribasushi) + - Stop deleting the wrong version (for downgrades) - Fix documentation for in the Cookbook (moltar) 0.001005 2011-04-13 15:21:08 CST6CDT diff --git a/t/02-instantiation-no-ddl.t b/t/02-instantiation-no-ddl.t index 289fa52..b892f2c 100644 --- a/t/02-instantiation-no-ddl.t +++ b/t/02-instantiation-no-ddl.t @@ -14,7 +14,8 @@ use Test::Exception; use DBI; DBICDHTest::ready; -my $dbh = DBI->connect('dbi:SQLite::memory:'); + +my $dbh = DBICDHTest::dbh(); my @connection = (sub { $dbh }, { ignore_version => 1 }); my $sql_dir = 't/sql'; diff --git a/t/02-instantiation-wo-component.t b/t/02-instantiation-wo-component.t index 360335f..fbf5723 100644 --- a/t/02-instantiation-wo-component.t +++ b/t/02-instantiation-wo-component.t @@ -14,7 +14,7 @@ use Test::Exception; DBICDHTest::ready; -my $dbh = DBI->connect('dbi:SQLite::memory:'); +my $dbh = DBICDHTest::dbh(); my @connection = (sub { $dbh }, { ignore_version => 1 }); my $sql_dir = 't/sql'; diff --git a/t/02-instantiation.t b/t/02-instantiation.t index 04a20f4..69ad089 100644 --- a/t/02-instantiation.t +++ b/t/02-instantiation.t @@ -14,7 +14,7 @@ use Test::Exception; DBICDHTest::ready; -my $dbh = DBI->connect('dbi:SQLite::memory:'); +my $dbh = DBICDHTest::dbh(); my @connection = (sub { $dbh }, { ignore_version => 1 }); my $sql_dir = 't/sql'; diff --git a/t/03-deprecated.t b/t/03-deprecated.t index f89950e..f29244a 100644 --- a/t/03-deprecated.t +++ b/t/03-deprecated.t @@ -13,7 +13,7 @@ use Test::Exception; DBICDHTest::ready; -my $dbh = DBI->connect('dbi:SQLite::memory:'); +my $dbh = DBICDHTest::dbh(); my @connection = (sub { $dbh }, { ignore_version => 1 }); my $sql_dir = 't/sql'; diff --git a/t/bugs/01-emailed-bug-01.t b/t/bugs/01-emailed-bug-01.t index 1303f04..dca69b9 100644 --- a/t/bugs/01-emailed-bug-01.t +++ b/t/bugs/01-emailed-bug-01.t @@ -14,7 +14,7 @@ use Test::Exception; DBICDHTest::ready; -my $dbh = DBI->connect('dbi:SQLite::memory:'); +my $dbh = DBICDHTest::dbh(); my @connection = (sub { $dbh }, { ignore_version => 1 }); my $sql_dir = 't/sql'; diff --git a/t/deploy_methods/sql_translator.t b/t/deploy_methods/sql_translator.t index bedc074..62094d9 100644 --- a/t/deploy_methods/sql_translator.t +++ b/t/deploy_methods/sql_translator.t @@ -12,7 +12,7 @@ use aliased 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator'; use File::Spec::Functions; use File::Path qw(rmtree mkpath); -my $dbh = DBI->connect('dbi:SQLite::memory:'); +my $dbh = DBICDHTest::dbh(); my @connection = (sub { $dbh }, { ignore_version => 1 }); my $sql_dir = 't/sql'; diff --git a/t/deploy_methods/sql_translator_deprecated.t b/t/deploy_methods/sql_translator_deprecated.t index 617b31c..709fcd0 100644 --- a/t/deploy_methods/sql_translator_deprecated.t +++ b/t/deploy_methods/sql_translator_deprecated.t @@ -10,7 +10,7 @@ use aliased use File::Spec::Functions; -my $dbh = DBI->connect('dbi:SQLite::memory:'); +my $dbh = DBICDHTest::dbh(); my @connection = (sub { $dbh }, { ignore_version => 1 }); my $sql_dir = 't/sql'; diff --git a/t/deploy_methods/sql_translator_protoschema_transform.t b/t/deploy_methods/sql_translator_protoschema_transform.t index 3771232..d0ce6cf 100644 --- a/t/deploy_methods/sql_translator_protoschema_transform.t +++ b/t/deploy_methods/sql_translator_protoschema_transform.t @@ -12,7 +12,7 @@ use aliased 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator'; use File::Spec::Functions; use File::Path qw(rmtree mkpath); -my $dbh = DBI->connect('dbi:SQLite::memory:'); +my $dbh = DBICDHTest::dbh(); my @connection = (sub { $dbh }, { ignore_version => 1 }); my $sql_dir = 't/sql'; diff --git a/t/lib/DBICDHTest.pm b/t/lib/DBICDHTest.pm index eddd418..013f79f 100644 --- a/t/lib/DBICDHTest.pm +++ b/t/lib/DBICDHTest.pm @@ -4,8 +4,7 @@ use strict; use warnings; use File::Path 'remove_tree'; -use Test::More; -use Test::Exception; +use DBI; sub ready { if (-d 't/sql') { @@ -14,4 +13,8 @@ sub ready { } } +sub dbh { + DBI->connect('dbi:SQLite::memory:', undef, undef, { RaiseError => 1 }) +} + 1; diff --git a/t/no-component-lib/DBICDHTest.pm b/t/no-component-lib/DBICDHTest.pm index eddd418..789e3e3 100644 --- a/t/no-component-lib/DBICDHTest.pm +++ b/t/no-component-lib/DBICDHTest.pm @@ -14,4 +14,8 @@ sub ready { } } +sub dbh { + DBI->connect('dbi:SQLite::memory:', undef, undef, { RaiseError => 1 }) +} + 1; diff --git a/t/version_storages/standard.t b/t/version_storages/standard.t index c683561..01bdb0e 100644 --- a/t/version_storages/standard.t +++ b/t/version_storages/standard.t @@ -13,7 +13,7 @@ use aliased 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator'; use DBICVersion_v1; use DBIx::Class::DeploymentHandler; -my $dbh = DBI->connect('dbi:SQLite::memory:'); +my $dbh = DBICDHTest::dbh(); my @connection = (sub { $dbh }, { ignore_version => 1 }); my $sql_dir = 't/sql';