-#!/usr/bin/perl
-
use strict;
use warnings;
-use Test::More;
use lib 't/lib';
-
-plan tests => 8;
+use DBICTest; # do not remove even though it is not used
+use Test::More tests => 8;
sub _chk_warning {
defined $_[0]?
defined $_[0]? $_[0] !~ /$p/ : 1;
}
+sub _verify_sources {
+ my @monikers = @_;
+ is_deeply (
+ [ sort DBICNSTest::RtBug41083->sources ],
+ \@monikers,
+ 'List of resultsource registrations',
+ );
+}
+
{
my $warnings;
eval {
package DBICNSTest::RtBug41083;
use base 'DBIx::Class::Schema';
__PACKAGE__->load_namespaces(
- result_namespace => 'Schema_A',
+ result_namespace => 'Result_A',
resultset_namespace => 'ResultSet_A',
default_resultset_class => 'ResultSet'
);
ok(!$@) or diag $@;
ok(_chk_warning($warnings), 'expected no resultset complaint');
ok(_chk_extra_sources_warning($warnings), 'expected no extra sources complaint') or diag($warnings);
-}
-is_deeply (
- [ DBICNSTest::RtBug41083->sources ],
- [qw/ /],
-);
+ _verify_sources (qw/A A::Sub/);
+}
{
my $warnings;
package DBICNSTest::RtBug41083;
use base 'DBIx::Class::Schema';
__PACKAGE__->load_namespaces(
- result_namespace => 'Schema',
- resultset_namespace => 'ResultSet',
default_resultset_class => 'ResultSet'
);
};
ok(!$@) or diag $@;
ok(_chk_warning($warnings), 'expected no resultset complaint') or diag $warnings;
ok(_chk_extra_sources_warning($warnings), 'expected no extra sources complaint') or diag($warnings);
-}
-
-is_deeply (
- [ DBICNSTest::RtBug41083->sources ],
- [qw/ /],
-);
+ _verify_sources (qw/A A::Sub Foo Foo::Sub/);
+}