Commit | Line | Data |
e9c270c5 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | use Test::More; |
6 | |
7 | use lib 't/lib'; |
8 | |
9 | plan tests => 2; |
10 | |
45f8858e |
11 | sub _chk_warning { |
12 | defined $_[0]? |
13 | $_[0] !~ qr/We found ResultSet class '([^']+)' for '([^']+)', but it seems that you had already set '([^']+)' to use '([^']+)' instead/ : |
14 | 1 |
15 | } |
16 | |
e9c270c5 |
17 | my $warnings; |
18 | eval { |
19 | local $SIG{__WARN__} = sub { $warnings .= shift }; |
20 | package DBICNSTest::RtBug41083; |
21 | use base 'DBIx::Class::Schema'; |
22 | __PACKAGE__->load_namespaces( |
45f8858e |
23 | result_namespace => 'Schema_A', |
24 | resultset_namespace => 'ResultSet_A', |
25 | default_resultset_class => 'ResultSet' |
26 | ); |
27 | }; |
28 | ok(!$@) or diag $@; |
29 | ok(_chk_warning($warnings), 'Works here'); |
30 | |
31 | eval { |
32 | local $SIG{__WARN__} = sub { $warnings .= shift }; |
33 | package DBICNSTest::RtBug41083; |
34 | use base 'DBIx::Class::Schema'; |
35 | __PACKAGE__->load_namespaces( |
e9c270c5 |
36 | result_namespace => 'Schema', |
37 | resultset_namespace => 'ResultSet', |
38 | default_resultset_class => 'ResultSet' |
39 | ); |
40 | }; |
41 | ok(!$@) or diag $@; |
45f8858e |
42 | ok(_chk_warning($warnings), 'Fails here'); |