Cleanup shebang lines of all maint/example scripts, remove from tests entirely
[dbsrgits/DBIx-Class.git] / t / 39load_namespaces_2.t
CommitLineData
44930c36 1use strict;
2use warnings;
3use Test::More;
4
d8190011 5use lib qw(t/lib);
6use DBICTest; # do not remove even though it is not used
44930c36 7
46a05fd4 8plan tests => 6;
44930c36 9
10my $warnings;
11eval {
12 local $SIG{__WARN__} = sub { $warnings .= shift };
13 package DBICNSTest;
14 use base qw/DBIx::Class::Schema/;
15 __PACKAGE__->load_namespaces(
c87014e8 16 result_namespace => 'Rslt',
44930c36 17 resultset_namespace => 'RSet',
44930c36 18 );
19};
20ok(!$@) or diag $@;
c87014e8 21like($warnings, qr/load_namespaces found ResultSet class C with no corresponding Result class/);
44930c36 22
23my $source_a = DBICNSTest->source('A');
24isa_ok($source_a, 'DBIx::Class::ResultSource::Table');
25my $rset_a = DBICNSTest->resultset('A');
26isa_ok($rset_a, 'DBICNSTest::RSet::A');
44930c36 27
28my $source_b = DBICNSTest->source('B');
29isa_ok($source_b, 'DBIx::Class::ResultSource::Table');
30my $rset_b = DBICNSTest->resultset('B');
31isa_ok($rset_b, 'DBIx::Class::ResultSet');