X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fstorage%2Fdeploy.t;h=233da2c66d816571282e022fa96c12029a33fcab;hb=4ca1fd6fb90a85f5138d11f580394025aa20ea4a;hp=d2bca4352a1daaceb26ba53f508e6704546f0273;hpb=076be7c46559c6c27b70946893e2f82d1ff4e0a0;p=dbsrgits%2FDBIx-Class.git diff --git a/t/storage/deploy.t b/t/storage/deploy.t index d2bca43..233da2c 100644 --- a/t/storage/deploy.t +++ b/t/storage/deploy.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More; +use Test::Exception; use lib qw(t/lib); use DBICTest; @@ -15,24 +16,32 @@ BEGIN { use File::Spec; use Path::Class qw/dir/; -use File::Path qw/make_path remove_tree/; + +lives_ok( sub { + my $parse_schema = DBICTest->init_schema(no_deploy => 1); + $parse_schema->deploy({},'t/lib/test_deploy'); + $parse_schema->resultset("Artist")->all(); +}, 'artist table deployed correctly' ); + my $schema = DBICTest->init_schema(); -my $var = dir (qw| t var create_ddl_dir |); --d $var - or make_path( "$var" ) - or die "can't create $var: $!"; +my $var = dir ("t/var/ddl_dir-$$"); +$var->mkpath unless -d $var; my $test_dir_1 = $var->subdir ('test1', 'foo', 'bar' ); -remove_tree( "$test_dir_1" ) if -d $test_dir_1; +$test_dir_1->rmtree if -d $test_dir_1; $schema->create_ddl_dir( undef, undef, $test_dir_1 ); ok( -d $test_dir_1, 'create_ddl_dir did a make_path on its target dir' ); ok( scalar( glob $test_dir_1.'/*.sql' ), 'there are sql files in there' ); -TODO: { - local $TODO = 'we should probably add some tests here for actual deployability of the DDL?'; - ok( 0 ); +{ + local $TODO = 'we should probably add some tests here for actual deployability of the DDL?'; + ok( 0 ); +} + +END { + $var->rmtree; } done_testing;