[Bast-commits] r9897 - ironman/IronMan-Web/trunk/t

idn at dev.catalyst.perl.org idn at dev.catalyst.perl.org
Wed Jul 6 14:43:17 GMT 2011


Author: idn
Date: 2011-07-06 14:43:17 +0000 (Wed, 06 Jul 2011)
New Revision: 9897

Added:
   ironman/IronMan-Web/trunk/t/02_testdb_deploy.t
Log:
We need to deploy a test db in order to do testing

Added: ironman/IronMan-Web/trunk/t/02_testdb_deploy.t
===================================================================
--- ironman/IronMan-Web/trunk/t/02_testdb_deploy.t	                        (rev 0)
+++ ironman/IronMan-Web/trunk/t/02_testdb_deploy.t	2011-07-06 14:43:17 UTC (rev 9897)
@@ -0,0 +1,33 @@
+use strict;
+use warnings;
+use Test::More;
+
+# Attempt to deploy the schema as a test database
+
+use IronMan::Schema;
+
+my $schema;
+my $dir = "t/var/";
+my $file = "test.db";
+
+# Check the var directory exists for our testing.
+unless(-d $dir) {
+    mkdir($dir);
+}
+
+# Check we don't already have a test database prior to stomping all over it...
+if(-e $dir . $file) {
+    plan skip_all => 'Test database file already exists.  Skipping creation.';
+} else {
+    plan tests => 3;
+}
+
+ok($schema = IronMan::Schema->connect("dbi:SQLite:$dir$file"), "Creating a schema object");
+ok($schema->deploy(), "Deploying the new schema object");
+
+# Check the file exists
+my $file_exists = (-e $dir . $file);
+
+ok($file_exists, "Test database file exists");
+
+




More information about the Bast-commits mailing list