Remove TODO labels from blocks not using todo_skip() - no test changes
[dbsrgits/DBIx-Class.git] / t / storage / deploy.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Exception;
6
7 use lib qw(t/lib);
8 use DBICTest;
9
10 BEGIN {
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
17 use File::Spec;
18 use Path::Class qw/dir/;
19
20 lives_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
26 my $schema = DBICTest->init_schema();
27
28 my $var = dir ("t/var/ddl_dir-$$");
29 $var->mkpath unless -d $var;
30
31 my $test_dir_1 = $var->subdir ('test1', 'foo', 'bar' );
32 $test_dir_1->rmtree if -d $test_dir_1;
33 $schema->create_ddl_dir( undef, undef, $test_dir_1 );
34
35 ok( -d $test_dir_1, 'create_ddl_dir did a make_path on its target dir' );
36 ok( scalar( glob $test_dir_1.'/*.sql' ), 'there are sql files in there' );
37
38 {
39   local $TODO = 'we should probably add some tests here for actual deployability of the DDL?';
40   ok( 0 );
41 }
42
43 END {
44   $var->rmtree;
45 }
46
47 done_testing;