moved mock schema out of t/var
[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/dbicadmin-test-include/lib'],
16       schema_class => 'Foo',
17       config => { Foo => {} },
18       config_stanza => 'Foo'
19   );
20   lives_ok { $admin->_build_schema } 'should survive attempt to load module located in include_dirs';
21   {
22     no warnings 'once';
23     ok($Foo::loaded);
24   }
25 }
26
27 done_testing;