minor fix to last committed test
[dbsrgits/DBIx-Class.git] / t / 39load_namespaces_2.t
CommitLineData
44930c36 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use Test::More;
6
d8190011 7use lib qw(t/lib);
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;
16 use base qw/DBIx::Class::Schema/;
17 __PACKAGE__->load_namespaces(
c87014e8 18 result_namespace => 'Rslt',
44930c36 19 resultset_namespace => 'RSet',
44930c36 20 );
21};
22ok(!$@) or diag $@;
c87014e8 23like($warnings, qr/load_namespaces found ResultSet class C with no corresponding Result class/);
44930c36 24
25my $source_a = DBICNSTest->source('A');
26isa_ok($source_a, 'DBIx::Class::ResultSource::Table');
27my $rset_a = DBICNSTest->resultset('A');
28isa_ok($rset_a, 'DBICNSTest::RSet::A');
44930c36 29
30my $source_b = DBICNSTest->source('B');
31isa_ok($source_b, 'DBIx::Class::ResultSource::Table');
32my $rset_b = DBICNSTest->resultset('B');
33isa_ok($rset_b, 'DBIx::Class::ResultSet');