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