Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 29 lines (23 sloc) 0.856 kb
44930c3 @blblack tests for load_namespaces
blblack authored
1 use strict;
2 use warnings;
3 use Test::More;
4
d819001 @ribasushi Require DBICTest.pm in all tests even if it is not needed at all
ribasushi authored
5 use lib qw(t/lib);
6 use DBICTest; # do not remove even though it is not used
44930c3 @blblack tests for load_namespaces
blblack authored
7
46a05fd @blblack remove result_class stuff from load_namespaces, better to not do it than...
blblack authored
8 plan tests => 6;
44930c3 @blblack tests for load_namespaces
blblack authored
9
10 my $warnings;
11 eval {
12 local $SIG{__WARN__} = sub { $warnings .= shift };
13 package DBICNSTest;
14 use base qw/DBIx::Class::Schema/;
25fb14b @blblack re-word options/code/pod to be less confusing wrt ResultSource vs source...
blblack authored
15 __PACKAGE__->load_namespaces( default_resultset_class => 'RSBase' );
44930c3 @blblack tests for load_namespaces
blblack authored
16 };
17 ok(!$@) or diag $@;
93d7452 @ribasushi Rename imprecisely named variables in the load_namespaces codepath
ribasushi authored
18 like($warnings, qr/load_namespaces found ResultSet class 'DBICNSTest::ResultSet::C' with no corresponding Result class/);
44930c3 @blblack tests for load_namespaces
blblack authored
19
20 my $source_a = DBICNSTest->source('A');
21 isa_ok($source_a, 'DBIx::Class::ResultSource::Table');
22 my $rset_a = DBICNSTest->resultset('A');
23 isa_ok($rset_a, 'DBICNSTest::ResultSet::A');
24
25 my $source_b = DBICNSTest->source('B');
26 isa_ok($source_b, 'DBIx::Class::ResultSource::Table');
27 my $rset_b = DBICNSTest->resultset('B');
28 isa_ok($rset_b, 'DBICNSTest::RSBase');
Something went wrong with that request. Please try again.