Resolve $rsrc instance duality on metadata traversal
[dbsrgits/DBIx-Class.git] / t / 39load_namespaces_4.t
CommitLineData
c0329273 1BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
44930c36 3use strict;
4use warnings;
5use Test::More;
6
c0329273 7
d8190011 8use DBICTest; # do not remove even though it is not used
44930c36 9
46a05fd4 10plan tests => 6;
44930c36 11
12my $warnings;
13eval {
14 local $SIG{__WARN__} = sub { $warnings .= shift };
15 package DBICNSTest;
a0216b74 16 use base qw/DBICTest::BaseSchema/;
25fb14bd 17 __PACKAGE__->load_namespaces( default_resultset_class => 'RSBase' );
44930c36 18};
19ok(!$@) or diag $@;
93d7452f 20like($warnings, qr/load_namespaces found ResultSet class 'DBICNSTest::ResultSet::C' with no corresponding Result class/);
44930c36 21
22my $source_a = DBICNSTest->source('A');
23isa_ok($source_a, 'DBIx::Class::ResultSource::Table');
24my $rset_a = DBICNSTest->resultset('A');
25isa_ok($rset_a, 'DBICNSTest::ResultSet::A');
44930c36 26
27my $source_b = DBICNSTest->source('B');
28isa_ok($source_b, 'DBIx::Class::ResultSource::Table');
29my $rset_b = DBICNSTest->resultset('B');
30isa_ok($rset_b, 'DBICNSTest::RSBase');