stub tests for all classes
Arthur Axel 'fREW' Schmidt [Fri, 19 Mar 2010 04:45:26 +0000 (23:45 -0500)]
t/02-instantiation.t
t/deploy_methods/sql_translator.t [new file with mode: 0644]
t/deploy_methods/sql_translator_deprecated.t [new file with mode: 0644]
t/lib/DBICDHTest.pm [new file with mode: 0644]
t/version_handlers/db_schema_versions.t
t/version_handlers/explict_versions.t
t/version_storages/standard.t [new file with mode: 0644]
t/version_storages/tiny.t [new file with mode: 0644]

index 7d67309..a401ec1 100644 (file)
@@ -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 (file)
index 0000000..2978776
--- /dev/null
@@ -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 (file)
index 0000000..ee05f89
--- /dev/null
@@ -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 (file)
index 0000000..6b76475
--- /dev/null
@@ -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;
index 2dedd1a..1c5d394 100644 (file)
@@ -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);
index c341d12..0c98a9a 100644 (file)
@@ -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 (file)
index 0000000..b2476d8
--- /dev/null
@@ -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 (file)
index 0000000..b2476d8
--- /dev/null
@@ -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;