Test written.
Jason M. Mills [Thu, 20 Nov 2008 12:45:48 +0000 (12:45 +0000)]
Currently fails.

t/39load_namespaces_rt41083.t [new file with mode: 0644]
t/lib/DBICNSTest/RtBug41083/ResultSet.pm [new file with mode: 0644]
t/lib/DBICNSTest/RtBug41083/ResultSet/Foo.pm [new file with mode: 0644]
t/lib/DBICNSTest/RtBug41083/Schema/Foo.pm [new file with mode: 0644]
t/lib/DBICNSTest/RtBug41083/Schema/Foo/Sub.pm [new file with mode: 0644]

diff --git a/t/39load_namespaces_rt41083.t b/t/39load_namespaces_rt41083.t
new file mode 100644 (file)
index 0000000..facb70f
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Test::More;
+
+use lib 't/lib';
+
+plan tests => 2;
+
+my $warnings;
+eval {
+    local $SIG{__WARN__} = sub { $warnings .= shift };
+    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(
+       $warnings !~
+       qr/We found ResultSet class '([^']+)' for '([^']+)', but it seems that you had already set '([^']+)' to use '([^']+)' instead/,
+       'Proxy sub class did not generate an error'
+);
diff --git a/t/lib/DBICNSTest/RtBug41083/ResultSet.pm b/t/lib/DBICNSTest/RtBug41083/ResultSet.pm
new file mode 100644 (file)
index 0000000..2e30409
--- /dev/null
@@ -0,0 +1,5 @@
+package DBICNSTest::RtBug41083::ResultSet;
+use strict;
+use warnings;
+use base 'DBIx::Class::ResultSet';
+1;
diff --git a/t/lib/DBICNSTest/RtBug41083/ResultSet/Foo.pm b/t/lib/DBICNSTest/RtBug41083/ResultSet/Foo.pm
new file mode 100644 (file)
index 0000000..f0731c3
--- /dev/null
@@ -0,0 +1,5 @@
+package DBICNSTest::RtBug41083::ResultSet::Foo;
+use strict;
+use warnings;
+use base 'DBICNSTest::RtBug41083::ResultSet';
+1;
diff --git a/t/lib/DBICNSTest/RtBug41083/Schema/Foo.pm b/t/lib/DBICNSTest/RtBug41083/Schema/Foo.pm
new file mode 100644 (file)
index 0000000..11f10e9
--- /dev/null
@@ -0,0 +1,8 @@
+package DBICNSTest::RtBug41083::Schema::Foo;
+use strict;
+use warnings;
+use base 'DBIx::Class';
+__PACKAGE__->load_components('Core');
+__PACKAGE__->table('foo');
+__PACKAGE__->add_columns('foo');
+1;
diff --git a/t/lib/DBICNSTest/RtBug41083/Schema/Foo/Sub.pm b/t/lib/DBICNSTest/RtBug41083/Schema/Foo/Sub.pm
new file mode 100644 (file)
index 0000000..73ec679
--- /dev/null
@@ -0,0 +1,5 @@
+package DBICNSTest::RtBug41083::Schema::Foo::Sub;
+use strict;
+use warnings;
+use base 'DBICNSTest::RtBug41083::Schema::Foo';
+1;