[Bast-commits] r5753 - DBIx-Class/0.08/trunk/t
jmmills at dev.catalyst.perl.org
jmmills at dev.catalyst.perl.org
Fri Mar 13 12:32:35 GMT 2009
Author: jmmills
Date: 2009-03-13 12:32:35 +0000 (Fri, 13 Mar 2009)
New Revision: 5753
Modified:
DBIx-Class/0.08/trunk/t/39load_namespaces_rt41083.t
Log:
Added test for source sub-class register_extra_sources warning.
Sub-classes should not generate this warning - bug via non-inhertiance sorting via register_source.
Modified: DBIx-Class/0.08/trunk/t/39load_namespaces_rt41083.t
===================================================================
--- DBIx-Class/0.08/trunk/t/39load_namespaces_rt41083.t 2009-03-13 07:11:57 UTC (rev 5752)
+++ DBIx-Class/0.08/trunk/t/39load_namespaces_rt41083.t 2009-03-13 12:32:35 UTC (rev 5753)
@@ -6,7 +6,7 @@
use lib 't/lib';
-plan tests => 4;
+plan tests => 6;
sub _chk_warning {
defined $_[0]?
@@ -14,6 +14,11 @@
1
}
+sub _chk_extra_sources_warning {
+ my $p = qr/already has a source, use register_extra_source for additional sources/;
+ defined $_[0]? $_[0] !~ /$p/ : 1;
+}
+
my $warnings;
eval {
local $SIG{__WARN__} = sub { $warnings .= shift };
@@ -26,7 +31,9 @@
);
};
ok(!$@) or diag $@;
-ok(_chk_warning($warnings), 'expected no complaint');
+ok(_chk_warning($warnings), 'expected no resultset complaint');
+ok(_chk_extra_sources_warning($warnings), 'expected no extra sources complaint');
+undef $warnings;
eval {
local $SIG{__WARN__} = sub { $warnings .= shift };
@@ -39,4 +46,6 @@
);
};
ok(!$@) or diag $@;
-ok(_chk_warning($warnings), 'expected no complaint') or diag $warnings;
+ok(_chk_warning($warnings), 'expected no resultset complaint') or diag $warnings;
+ok(_chk_extra_sources_warning($warnings), 'expected no extra sources complaint');
+undef $warnings;
More information about the Bast-commits
mailing list