Commit | Line | Data |
44930c36 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | use Test::More; |
6 | |
7 | unshift(@INC, './t/lib'); |
8 | |
46a05fd4 |
9 | plan tests => 7; |
44930c36 |
10 | |
11 | my $warnings; |
12 | eval { |
13 | local $SIG{__WARN__} = sub { $warnings .= shift }; |
14 | package DBICNSTestOther; |
15 | use base qw/DBIx::Class::Schema/; |
16 | __PACKAGE__->load_namespaces( |
c87014e8 |
17 | result_namespace => [ '+DBICNSTest::Rslt', '+DBICNSTest::OtherRslt' ], |
44930c36 |
18 | resultset_namespace => '+DBICNSTest::RSet', |
44930c36 |
19 | ); |
20 | }; |
21 | ok(!$@) or diag $@; |
c87014e8 |
22 | like($warnings, qr/load_namespaces found ResultSet class C with no corresponding Result class/); |
44930c36 |
23 | |
24 | my $source_a = DBICNSTestOther->source('A'); |
25 | isa_ok($source_a, 'DBIx::Class::ResultSource::Table'); |
26 | my $rset_a = DBICNSTestOther->resultset('A'); |
27 | isa_ok($rset_a, 'DBICNSTest::RSet::A'); |
44930c36 |
28 | |
29 | my $source_b = DBICNSTestOther->source('B'); |
30 | isa_ok($source_b, 'DBIx::Class::ResultSource::Table'); |
31 | my $rset_b = DBICNSTestOther->resultset('B'); |
32 | isa_ok($rset_b, 'DBIx::Class::ResultSet'); |
f017c022 |
33 | |
34 | my $source_d = DBICNSTestOther->source('D'); |
35 | isa_ok($source_d, 'DBIx::Class::ResultSource::Table'); |