Better exception when things get really really bad with prepare()
[dbsrgits/DBIx-Class.git] / t / storage / deploy.t
CommitLineData
4068e05f 1use strict;
2use warnings;
3
4use Test::More;
5
6use lib qw(t/lib);
7use DBICTest;
8
43d2a76e 9BEGIN {
10 require DBIx::Class;
11 plan skip_all =>
12 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('deploy')
13 unless DBIx::Class::Optional::Dependencies->req_ok_for ('deploy')
14}
15
4068e05f 16use File::Spec;
076be7c4 17use Path::Class qw/dir/;
18use File::Path qw/make_path remove_tree/;
4068e05f 19my $schema = DBICTest->init_schema();
20
076be7c4 21my $var = dir (qw| t var create_ddl_dir |);
4068e05f 22-d $var
076be7c4 23 or make_path( "$var" )
24 or die "can't create $var: $!";
4068e05f 25
076be7c4 26my $test_dir_1 = $var->subdir ('test1', 'foo', 'bar' );
27remove_tree( "$test_dir_1" ) if -d $test_dir_1;
4068e05f 28$schema->create_ddl_dir( undef, undef, $test_dir_1 );
29
076be7c4 30ok( -d $test_dir_1, 'create_ddl_dir did a make_path on its target dir' );
4068e05f 31ok( scalar( glob $test_dir_1.'/*.sql' ), 'there are sql files in there' );
32
33TODO: {
34 local $TODO = 'we should probably add some tests here for actual deployability of the DDL?';
35 ok( 0 );
36}
37
38done_testing;