Relax developer policy, allowing to skip optional dependencies when in a checkout
[dbsrgits/DBIx-Class.git] / t / storage / deploy.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5
6 use lib qw(t/lib);
7 use DBICTest;
8
9 BEGIN {
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
16 use File::Spec;
17 use File::Path qw/ mkpath rmtree /;
18
19 my $schema = DBICTest->init_schema();
20
21 my $var = File::Spec->catfile(qw| t var create_ddl_dir |);
22 -d $var
23     or mkpath($var)
24     or die "can't create $var";
25
26 my $test_dir_1 =  File::Spec->catdir( $var, 'test1', 'foo', 'bar' );
27 rmtree( $test_dir_1 ) if -d $test_dir_1;
28 $schema->create_ddl_dir( undef, undef, $test_dir_1 );
29
30 ok( -d $test_dir_1, 'create_ddl_dir did a mkpath on its target dir' );
31 ok( scalar( glob $test_dir_1.'/*.sql' ), 'there are sql files in there' );
32
33 TODO: {
34     local $TODO = 'we should probably add some tests here for actual deployability of the DDL?';
35     ok( 0 );
36 }
37
38 done_testing;