Set up test database automatically when testing
[gruntmaster-data.git] / t / Gruntmaster-Data.t
index d7e2d7faedbd54b4fc3db3267b31d7f6bdfec040..54861af544b218237a321ccfdfd9ed3bfb5bd289 100644 (file)
@@ -9,10 +9,15 @@ use Test::More;
 BEGIN {
        eval {
                Gruntmaster::Data::init 'dbi:Pg:dbname=gmtest'; 1;
-       } or plan skip_all => 'Cannot connect to test database. Create it by running make_test_db.sh before running this test. '. "Error: $@";
+       } or plan skip_all => 'Cannot connect to test database. Create it by running createdb gmtest before running this test. '. "Error: $@";
        plan tests => 37;
 }
 
+note 'Setting up test database';
+$ENV{PGOPTIONS} = '-c client_min_messages=WARNING';
+system 'psql', 'gmtest', '-qf', 'db.sql';
+system 'psql', 'gmtest', '-qf', 'testdata.sql';
+
 note 'Running update_status';
 update_status;
 
This page took 0.010104 seconds and 4 git commands to generate.