[Bast-commits] r4169 - in DBIx-Class/0.08/trunk/t: . lib lib/DBICErrorTest lib/DBICErrorTest/ResultSet lib/DBICErrorTest/Schema

ash at dev.catalyst.perl.org ash at dev.catalyst.perl.org
Tue Mar 11 14:38:10 GMT 2008


Author: ash
Date: 2008-03-11 14:38:10 +0000 (Tue, 11 Mar 2008)
New Revision: 4169

Added:
   DBIx-Class/0.08/trunk/t/98source_load_error.t
   DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/
   DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/ResultSet/
   DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/ResultSet/WithError.pm
   DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/Schema/
   DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/Schema/SourceWithError.pm
   DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/SyntaxError.pm
Log:
test to make sure the errors in components of resultset classes are reported right.

Added: DBIx-Class/0.08/trunk/t/98source_load_error.t
===================================================================
--- DBIx-Class/0.08/trunk/t/98source_load_error.t	                        (rev 0)
+++ DBIx-Class/0.08/trunk/t/98source_load_error.t	2008-03-11 14:38:10 UTC (rev 4169)
@@ -0,0 +1,15 @@
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+use lib qw(t/lib);
+eval {
+  package DBICErrorTest::Schema;
+
+  use base 'DBIx::Class::Schema';
+  __PACKAGE__->load_classes('SourceWithError');
+};
+
+# Make sure the errors in components of resultset classes are reported right.
+like($@, qr!syntax error at t/lib/DBICErrorTest/SyntaxError.pm!);

Added: DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/ResultSet/WithError.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/ResultSet/WithError.pm	                        (rev 0)
+++ DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/ResultSet/WithError.pm	2008-03-11 14:38:10 UTC (rev 4169)
@@ -0,0 +1,10 @@
+package DBICErrorTest::ResultSet::WithError;
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::ResultSet';
+
+__PACKAGE__->load_components('+DBICErrorTest::SyntaxError');
+
+1;

Added: DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/Schema/SourceWithError.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/Schema/SourceWithError.pm	                        (rev 0)
+++ DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/Schema/SourceWithError.pm	2008-03-11 14:38:10 UTC (rev 4169)
@@ -0,0 +1,13 @@
+package DBICErrorTest::Schema::SourceWithError;
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+__PACKAGE__->load_components('Core');
+__PACKAGE__->table('foo');
+#__PACKAGE__->load_components('+DBICErrorTest::SyntaxError');
+require DBICErrorTest::ResultSet::WithError;
+__PACKAGE__->resultset_class('DBICErrorTest::ResultSet::WithError');
+
+1;

Added: DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/SyntaxError.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/SyntaxError.pm	                        (rev 0)
+++ DBIx-Class/0.08/trunk/t/lib/DBICErrorTest/SyntaxError.pm	2008-03-11 14:38:10 UTC (rev 4169)
@@ -0,0 +1,5 @@
+package DBICErrorTest::SyntaxError;
+
+use strict;
+
+I'm a syntax error!




More information about the Bast-commits mailing list