Simplify includedir testing
[dbsrgits/DBIx-Class.git] / t / admin / 04include.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Exception;
6
7 BEGIN {
8     require DBIx::Class;
9     plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('admin')
10       unless DBIx::Class::Optional::Dependencies->req_ok_for('admin');
11 }
12
13 if(use_ok 'DBIx::Class::Admin') {
14   my $admin = DBIx::Class::Admin->new(
15       include_dirs => ['t/lib/testinclude'],
16       schema_class => 'DBICTestAdminInc',
17       config => { DBICTestAdminInc => {} },
18       config_stanza => 'DBICTestAdminInc'
19   );
20   lives_ok { $admin->_build_schema } 'should survive attempt to load module located in include_dirs';
21   {
22     no warnings 'once';
23     ok($DBICTestAdminInc::loaded);
24   }
25 }
26
27 done_testing;