7 use Test::More tests => 8;
13 $_[0] !~ qr/We found ResultSet class '([^']+)' for '([^']+)', but it seems that you had already set '([^']+)' to use '([^']+)' instead/ :
17 sub _chk_extra_sources_warning {
18 my $p = qr/already has a source, use register_extra_source for additional sources/;
19 defined $_[0]? $_[0] !~ /$p/ : 1;
25 [ sort DBICNSTest::RtBug41083->sources ],
27 'List of resultsource registrations',
34 local $SIG{__WARN__} = sub { $warnings .= shift };
35 package DBICNSTest::RtBug41083;
36 use base 'DBIx::Class::Schema';
37 __PACKAGE__->load_namespaces(
38 result_namespace => 'Schema_A',
39 resultset_namespace => 'ResultSet_A',
40 default_resultset_class => 'ResultSet'
45 ok(_chk_warning($warnings), 'expected no resultset complaint');
46 ok(_chk_extra_sources_warning($warnings), 'expected no extra sources complaint') or diag($warnings);
48 _verify_sources (qw/A A::Sub/);
54 local $SIG{__WARN__} = sub { $warnings .= shift };
55 package DBICNSTest::RtBug41083;
56 use base 'DBIx::Class::Schema';
57 __PACKAGE__->load_namespaces(
58 result_namespace => 'Schema',
59 resultset_namespace => 'ResultSet',
60 default_resultset_class => 'ResultSet'
64 ok(_chk_warning($warnings), 'expected no resultset complaint') or diag $warnings;
65 ok(_chk_extra_sources_warning($warnings), 'expected no extra sources complaint') or diag($warnings);
67 _verify_sources (qw/A A::Sub Foo Foo::Sub/);