Remove TODO labels from blocks not using todo_skip() - no test changes
[dbsrgits/DBIx-Class.git] / t / storage / deploy.t
CommitLineData
4068e05f 1use strict;
2use warnings;
3
4use Test::More;
91d0c99f 5use Test::Exception;
4068e05f 6
7use lib qw(t/lib);
8use DBICTest;
9
43d2a76e 10BEGIN {
11 require DBIx::Class;
12 plan skip_all =>
13 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('deploy')
14 unless DBIx::Class::Optional::Dependencies->req_ok_for ('deploy')
15}
16
4068e05f 17use File::Spec;
076be7c4 18use Path::Class qw/dir/;
91d0c99f 19
20lives_ok( sub {
21 my $parse_schema = DBICTest->init_schema(no_deploy => 1);
22 $parse_schema->deploy({},'t/lib/test_deploy');
23 $parse_schema->resultset("Artist")->all();
24}, 'artist table deployed correctly' );
25
4068e05f 26my $schema = DBICTest->init_schema();
27
8d6b1478 28my $var = dir ("t/var/ddl_dir-$$");
29$var->mkpath unless -d $var;
4068e05f 30
076be7c4 31my $test_dir_1 = $var->subdir ('test1', 'foo', 'bar' );
8d6b1478 32$test_dir_1->rmtree if -d $test_dir_1;
4068e05f 33$schema->create_ddl_dir( undef, undef, $test_dir_1 );
34
076be7c4 35ok( -d $test_dir_1, 'create_ddl_dir did a make_path on its target dir' );
4068e05f 36ok( scalar( glob $test_dir_1.'/*.sql' ), 'there are sql files in there' );
37
4ca1fd6f 38{
39 local $TODO = 'we should probably add some tests here for actual deployability of the DDL?';
40 ok( 0 );
4068e05f 41}
42
8d6b1478 43END {
44 $var->rmtree;
45}
46
4068e05f 47done_testing;