From: Jason M. Mills Date: Thu, 20 Nov 2008 12:45:48 +0000 (+0000) Subject: Test written. X-Git-Tag: v0.08240~91^2~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e9c270c5e1e031c7ab0bd733304e8f240d05c5d2;p=dbsrgits%2FDBIx-Class.git Test written. Currently fails. --- diff --git a/t/39load_namespaces_rt41083.t b/t/39load_namespaces_rt41083.t new file mode 100644 index 0000000..facb70f --- /dev/null +++ b/t/39load_namespaces_rt41083.t @@ -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 index 0000000..2e30409 --- /dev/null +++ b/t/lib/DBICNSTest/RtBug41083/ResultSet.pm @@ -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 index 0000000..f0731c3 --- /dev/null +++ b/t/lib/DBICNSTest/RtBug41083/ResultSet/Foo.pm @@ -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 index 0000000..11f10e9 --- /dev/null +++ b/t/lib/DBICNSTest/RtBug41083/Schema/Foo.pm @@ -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 index 0000000..73ec679 --- /dev/null +++ b/t/lib/DBICNSTest/RtBug41083/Schema/Foo/Sub.pm @@ -0,0 +1,5 @@ +package DBICNSTest::RtBug41083::Schema::Foo::Sub; +use strict; +use warnings; +use base 'DBICNSTest::RtBug41083::Schema::Foo'; +1;