From: Arthur Axel 'fREW' Schmidt Date: Fri, 19 Mar 2010 04:45:26 +0000 (-0500) Subject: stub tests for all classes X-Git-Tag: v0.001000_01~91 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=02d58ac05dd4ccbe5fd4ff8a9cc58681ee1b74ee;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git stub tests for all classes --- diff --git a/t/02-instantiation.t b/t/02-instantiation.t index 7d67309..a401ec1 100644 --- a/t/02-instantiation.t +++ b/t/02-instantiation.t @@ -5,17 +5,14 @@ use Test::Exception; use File::Path 'remove_tree'; use lib 't/lib'; +use DBICDHTest; use DBICTest; use DBIx::Class::DeploymentHandler; my $db = 'dbi:SQLite:db.db'; my @connection = ($db, '', '', { ignore_version => 1 }); my $sql_dir = 't/sql'; -unlink 'db.db' if -e 'db.db'; -if (-d 't/sql') { - remove_tree('t/sql'); - mkdir 't/sql'; -} +DBICDHTest::ready; VERSION1: { use_ok 'DBICVersion_v1'; diff --git a/t/deploy_methods/sql_translator.t b/t/deploy_methods/sql_translator.t new file mode 100644 index 0000000..2978776 --- /dev/null +++ b/t/deploy_methods/sql_translator.t @@ -0,0 +1,11 @@ +#!perl + +use Test::More; +use Test::Exception; + +use lib 't/lib'; +use DBICDHTest; +use DBICTest; +use_ok 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator'; + +done_testing; diff --git a/t/deploy_methods/sql_translator_deprecated.t b/t/deploy_methods/sql_translator_deprecated.t new file mode 100644 index 0000000..ee05f89 --- /dev/null +++ b/t/deploy_methods/sql_translator_deprecated.t @@ -0,0 +1,12 @@ + +#!perl + +use Test::More; +use Test::Exception; + +use lib 't/lib'; +use DBICDHTest; +use DBICTest; +use_ok 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated'; + +done_testing; diff --git a/t/lib/DBICDHTest.pm b/t/lib/DBICDHTest.pm new file mode 100644 index 0000000..6b76475 --- /dev/null +++ b/t/lib/DBICDHTest.pm @@ -0,0 +1,17 @@ +package DBICDHTest; + +use strict; +use warnings; + +use File::Path 'remove_tree'; + +sub ready { + unlink 'db.db' if -e 'db.db'; + if (-d 't/sql') { + remove_tree('t/sql'); + mkdir 't/sql'; + } +} + + +1; diff --git a/t/version_handlers/db_schema_versions.t b/t/version_handlers/db_schema_versions.t index 2dedd1a..1c5d394 100644 --- a/t/version_handlers/db_schema_versions.t +++ b/t/version_handlers/db_schema_versions.t @@ -4,6 +4,7 @@ use Test::More; use Test::Exception; use lib 't/lib'; +use DBICDHTest; use DBICTest; use DBIx::Class::DeploymentHandler; use DBIx::Class::DeploymentHandler::VersionHandler::ExplicitVersions; @@ -11,12 +12,7 @@ my $db = 'dbi:SQLite:db.db'; my @connection = ($db, '', '', { ignore_version => 1 }); my $sql_dir = 't/sql'; -unlink 'db.db' if -e 'db.db'; -if (-d 't/sql') { - unlink $_ for glob('t/sql/*'); -} else { - mkdir 't/sql'; -} +DBICDHTest::ready; use DBICVersion_v1; my $s = DBICVersion::Schema->connect(@connection); diff --git a/t/version_handlers/explict_versions.t b/t/version_handlers/explict_versions.t index c341d12..0c98a9a 100644 --- a/t/version_handlers/explict_versions.t +++ b/t/version_handlers/explict_versions.t @@ -4,6 +4,7 @@ use Test::More; use Test::Exception; use lib 't/lib'; +use DBICDHTest; use DBICTest; use DBIx::Class::DeploymentHandler; use DBIx::Class::DeploymentHandler::VersionHandler::ExplicitVersions; @@ -11,12 +12,7 @@ my $db = 'dbi:SQLite:db.db'; my @connection = ($db, '', '', { ignore_version => 1 }); my $sql_dir = 't/sql'; -unlink 'db.db' if -e 'db.db'; -if (-d 't/sql') { - unlink $_ for glob('t/sql/*'); -} else { - mkdir 't/sql'; -} +DBICDHTest::ready; use DBICVersion_v1; my $s = DBICVersion::Schema->connect(@connection); diff --git a/t/version_storages/standard.t b/t/version_storages/standard.t new file mode 100644 index 0000000..b2476d8 --- /dev/null +++ b/t/version_storages/standard.t @@ -0,0 +1,11 @@ +#!perl + +use Test::More; +use Test::Exception; + +use lib 't/lib'; +use DBICDHTest; +use DBICTest; +use_ok 'DBIx::Class::DeploymentHandler::VersionStorage::Standard'; + +done_testing; diff --git a/t/version_storages/tiny.t b/t/version_storages/tiny.t new file mode 100644 index 0000000..b2476d8 --- /dev/null +++ b/t/version_storages/tiny.t @@ -0,0 +1,11 @@ +#!perl + +use Test::More; +use Test::Exception; + +use lib 't/lib'; +use DBICDHTest; +use DBICTest; +use_ok 'DBIx::Class::DeploymentHandler::VersionStorage::Standard'; + +done_testing;