Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow tests to run properly

- Proper testing directories
- Added cleanup of test db
  • Loading branch information...
commit 37360d8348fdecc9026b1cf17505ec85caa8d5a5 1 parent d618f3e
@mfontani authored
View
1  config.yml
@@ -23,6 +23,7 @@ engines:
path:
- /
- ./views
+ - ../views
# Admin user sessions stored in cookie -- change the cookie key!
session: "cookie"
View
9 t/001_base.t
@@ -1,5 +1,12 @@
-use Test::More tests => 1;
+use Test::More tests => 2;
use strict;
use warnings;
use_ok 'Brocco';
+
+chdir 't/';
+
+diag("Deploying development schema..");
+rename('brocco.db','brocco.db.old') if -f 'brocco.db';
+qx{../bin/deploy_schema ../environments/development.yml};
+ok(-f 'brocco.db') or BAIL_OUT("Need brocco.db to continue further testing");
View
1  t/002_index_route.t
@@ -4,6 +4,7 @@ use warnings;
# the order is important
use Brocco;
+BEGIN{ chdir 't/' }
use Dancer::Test;
route_exists [ GET => '/' ], 'a route handler is defined for /';
View
1  t/003-article-N.t
@@ -4,6 +4,7 @@ use warnings;
# the order is important
use Brocco;
+BEGIN{ chdir 't/' }
use Dancer::Test;
route_exists [ GET => '/article/1' ], 'a route handler is defined for /article/1';
View
1  t/004-admin-login.t
@@ -4,6 +4,7 @@ use warnings;
# the order is important
use Brocco;
+BEGIN{ chdir 't/' }
use Dancer::Test;
use Data::Dumper;
View
1  t/004-admin.t
@@ -4,6 +4,7 @@ use warnings;
# the order is important
use Brocco;
+BEGIN{ chdir 't/' }
use Dancer::Test;
use Data::Dumper;
View
11 t/999-cleanup.t
@@ -0,0 +1,11 @@
+use Test::More tests => 2;
+use strict;
+use warnings;
+
+chdir 't/';
+
+ok(-f 'brocco.db');
+
+unlink 'brocco.db';
+
+ok(!-f 'brocco.db');
Please sign in to comment.
Something went wrong with that request. Please try again.