5 use DBICTest; # do not remove even though it is not used
6 use Test::More tests => 8;
10 $_[0] !~ qr/We found ResultSet class '([^']+)' for '([^']+)', but it seems that you had already set '([^']+)' to use '([^']+)' instead/ :
14 sub _chk_extra_sources_warning {
15 my $p = qr/already has a source, use register_extra_source for additional sources/;
16 defined $_[0]? $_[0] !~ /$p/ : 1;
22 [ sort DBICNSTest::RtBug41083->sources ],
24 'List of resultsource registrations',
31 local $SIG{__WARN__} = sub { $warnings .= shift };
32 package DBICNSTest::RtBug41083;
33 use base 'DBIx::Class::Schema';
34 __PACKAGE__->load_namespaces(
35 result_namespace => 'Result_A',
36 resultset_namespace => 'ResultSet_A',
37 default_resultset_class => 'ResultSet'
42 ok(_chk_warning($warnings), 'expected no resultset complaint');
43 ok(_chk_extra_sources_warning($warnings), 'expected no extra sources complaint') or diag($warnings);
45 _verify_sources (qw/A A::Sub/);
51 local $SIG{__WARN__} = sub { $warnings .= shift };
52 package DBICNSTest::RtBug41083;
53 use base 'DBIx::Class::Schema';
54 __PACKAGE__->load_namespaces(
55 default_resultset_class => 'ResultSet'
59 ok(_chk_warning($warnings), 'expected no resultset complaint') or diag $warnings;
60 ok(_chk_extra_sources_warning($warnings), 'expected no extra sources complaint') or diag($warnings);
62 _verify_sources (qw/A A::Sub Foo Foo::Sub/);