[Bast-commits] r7811 - DBIx-Class/0.08/trunk/t

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Wed Oct 21 14:33:45 GMT 2009


Author: ribasushi
Date: 2009-10-21 14:33:45 +0000 (Wed, 21 Oct 2009)
New Revision: 7811

Modified:
   DBIx-Class/0.08/trunk/t/100populate.t
Log:
Show what's wrong with the current populate code

Modified: DBIx-Class/0.08/trunk/t/100populate.t
===================================================================
--- DBIx-Class/0.08/trunk/t/100populate.t	2009-10-21 02:07:05 UTC (rev 7810)
+++ DBIx-Class/0.08/trunk/t/100populate.t	2009-10-21 14:33:45 UTC (rev 7811)
@@ -5,6 +5,7 @@
 use Test::Exception;
 use lib qw(t/lib);
 use DBICTest;
+use Path::Class::File ();
 
 my $schema = DBICTest->init_schema();
 
@@ -218,4 +219,43 @@
   ]);
 } qr/inconsistent/, 'literal sql must be the same in all slices';
 
+# the stringification has nothing to do with the artist name
+# this is solely for testing consistency
+my $fn = Path::Class::File->new ('somedir/somefilename.tmp');
+my $fn2 = Path::Class::File->new ('somedir/someotherfilename.tmp');
+
+lives_ok {
+  $rs->populate([
+    {
+      name => 'supplied before stringifying object',
+    },
+    {
+      name => $fn,
+    }
+  ]);
+} 'stringifying objects pass through';
+
+# ... and vice-versa.
+
+lives_ok {
+  $rs->populate([
+    {
+      name => $fn2,
+    },
+    {
+      name => 'supplied after stringifying object',
+    },
+  ]);
+} 'stringifying objects pass through';
+
+for (
+  $fn,
+  $fn2,
+  'supplied after stringifying object',
+  'supplied before stringifying object'
+) {
+  my $row = $rs->find ({name => $_});
+  ok ($row, "Stringification test row '$_' properly inserted");
+}
+
 done_testing;




More information about the Bast-commits mailing list