Cleanup shebang lines of all maint/example scripts, remove from tests entirely
[dbsrgits/DBIx-Class.git] / t / 39load_namespaces_3.t
1 use strict;
2 use warnings;
3 use Test::More;
4 use Test::Exception;
5 use Test::Warn;
6
7 use lib qw(t/lib);
8 use DBICTest; # do not remove even though it is not used
9
10 lives_ok (sub {
11   warnings_exist ( sub {
12       package DBICNSTestOther;
13       use base qw/DBIx::Class::Schema/;
14       __PACKAGE__->load_namespaces(
15           result_namespace => [ '+DBICNSTest::Rslt', '+DBICNSTest::OtherRslt' ],
16           resultset_namespace => '+DBICNSTest::RSet',
17       );
18     },
19     qr/load_namespaces found ResultSet class C with no corresponding Result class/,
20   );
21 });
22
23 my $source_a = DBICNSTestOther->source('A');
24 isa_ok($source_a, 'DBIx::Class::ResultSource::Table');
25 my $rset_a   = DBICNSTestOther->resultset('A');
26 isa_ok($rset_a, 'DBICNSTest::RSet::A');
27
28 my $source_b = DBICNSTestOther->source('B');
29 isa_ok($source_b, 'DBIx::Class::ResultSource::Table');
30 my $rset_b   = DBICNSTestOther->resultset('B');
31 isa_ok($rset_b, 'DBIx::Class::ResultSet');
32
33 my $source_d = DBICNSTestOther->source('D');
34 isa_ok($source_d, 'DBIx::Class::ResultSource::Table');
35
36 done_testing;