Sketches of tests that should ultimately pass
[dbsrgits/DBIx-Class.git] / t / 39load_namespaces_3.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 => 7;
44930c36 11
12my $warnings;
13eval {
14 local $SIG{__WARN__} = sub { $warnings .= shift };
15 package DBICNSTestOther;
16 use base qw/DBIx::Class::Schema/;
17 __PACKAGE__->load_namespaces(
c87014e8 18 result_namespace => [ '+DBICNSTest::Rslt', '+DBICNSTest::OtherRslt' ],
44930c36 19 resultset_namespace => '+DBICNSTest::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 = DBICNSTestOther->source('A');
26isa_ok($source_a, 'DBIx::Class::ResultSource::Table');
27my $rset_a = DBICNSTestOther->resultset('A');
28isa_ok($rset_a, 'DBICNSTest::RSet::A');
44930c36 29
30my $source_b = DBICNSTestOther->source('B');
31isa_ok($source_b, 'DBIx::Class::ResultSource::Table');
32my $rset_b = DBICNSTestOther->resultset('B');
33isa_ok($rset_b, 'DBIx::Class::ResultSet');
f017c022 34
35my $source_d = DBICNSTestOther->source('D');
36isa_ok($source_d, 'DBIx::Class::ResultSource::Table');