[Bast-commits] r5064 - DBIx-Class/0.08/trunk/t/cdbi-t

schwern at dev.catalyst.perl.org schwern at dev.catalyst.perl.org
Thu Nov 6 12:44:36 GMT 2008


Author: schwern
Date: 2008-11-06 12:44:36 +0000 (Thu, 06 Nov 2008)
New Revision: 5064

Modified:
   DBIx-Class/0.08/trunk/t/cdbi-t/15-accessor.t
Log:
A little indentation clean up

Test the result of an eval directly.

discard the changes to $sandl to quiet an "object destroyed with changes"
warning.

Modified: DBIx-Class/0.08/trunk/t/cdbi-t/15-accessor.t
===================================================================
--- DBIx-Class/0.08/trunk/t/cdbi-t/15-accessor.t	2008-11-06 12:44:27 UTC (rev 5063)
+++ DBIx-Class/0.08/trunk/t/cdbi-t/15-accessor.t	2008-11-06 12:44:36 UTC (rev 5064)
@@ -8,7 +8,7 @@
         next;
     }
     eval "use DBD::SQLite";
-    plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 54);
+    plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 55);
 }
 
 INIT {
@@ -17,9 +17,11 @@
     use lib 't/testlib';
     require Film;
     require Actor;
-        require Director;
+    require Director;
+
     Actor->has_a(film => 'Film');
-        Film->has_a(director => 'Director');
+    Film->has_a(director => 'Director');
+
     sub Class::DBI::sheep { ok 0; }
 }
 
@@ -108,7 +110,7 @@
     my $bt = Film->create($data);
     my $ac = Actor->create($p_data);
 
-    eval { my $f = $ac->film };
+    ok !eval { my $f = $ac->film; 1 };
     like $@, qr/film/, "no hasa film";
 
     eval {
@@ -212,4 +214,6 @@
     like $@, qr/read only/, "And can't delete 4 Days in July";
     my $abigail = eval { Film->create({ title => "Abigail's Party" }) };
     like $@, qr/read only/, "Or create new films";
+
+    $sandl->discard_changes;
 }




More information about the Bast-commits mailing list