[Bast-commits] r5540 - DBIx-Class/0.08/branches/multi_stuff/t

robkinyon at dev.catalyst.perl.org robkinyon at dev.catalyst.perl.org
Fri Feb 20 03:30:19 GMT 2009


Author: robkinyon
Date: 2009-02-20 03:30:17 +0000 (Fri, 20 Feb 2009)
New Revision: 5540

Modified:
   DBIx-Class/0.08/branches/multi_stuff/t/96multi_create.t
   DBIx-Class/0.08/branches/multi_stuff/t/96multi_create_new.t
Log:
fixed a few more test situations

Modified: DBIx-Class/0.08/branches/multi_stuff/t/96multi_create.t
===================================================================
--- DBIx-Class/0.08/branches/multi_stuff/t/96multi_create.t	2009-02-20 03:27:41 UTC (rev 5539)
+++ DBIx-Class/0.08/branches/multi_stuff/t/96multi_create.t	2009-02-20 03:30:17 UTC (rev 5540)
@@ -6,7 +6,7 @@
 use lib qw(t/lib);
 use DBICTest;
 
-plan tests => 79;
+plan tests => 77;
 
 my $schema = DBICTest->init_schema();
 
@@ -513,9 +513,6 @@
 };
 diag $@ if $@;
 
-TODO: {
-local $TODO = 'Next 2 evals are NOT supposed to work, jnaps code will be torn to bits in another branch';
-#SPECIAL_CASE
 eval {
   my $kurt_cobain = { name => 'Kurt Cobain' };
 
@@ -536,7 +533,8 @@
 };
 diag $@ if $@;
 
-#SPECIAL_CASE2
+=pod
+# This test case has been moved to t/96multi_create/cd_single.t
 eval {
   my $pink_floyd = { name => 'Pink Floyd' };
 
@@ -552,9 +550,8 @@
   is($a->cds && $a->cds->first->title, 'The Wall', 'CD insertion ok');
 };
 diag $@ if $@;
-}
+=cut
 
-
 diag '* Create foreign key col obj including PK (See test 20 in 66relationships.t)';
 eval {
   my $new_cd_hashref = { 

Modified: DBIx-Class/0.08/branches/multi_stuff/t/96multi_create_new.t
===================================================================
--- DBIx-Class/0.08/branches/multi_stuff/t/96multi_create_new.t	2009-02-20 03:27:41 UTC (rev 5539)
+++ DBIx-Class/0.08/branches/multi_stuff/t/96multi_create_new.t	2009-02-20 03:30:17 UTC (rev 5540)
@@ -6,7 +6,7 @@
 use lib qw(t/lib);
 use DBICTest;
 
-plan 'no_plan';
+plan tests => 6;
 
 my $schema = DBICTest->init_schema();
 
@@ -22,28 +22,31 @@
 # to new(). All other objects should be insert()able afterwards too.
 
 
-my $new_artist = $schema->resultset("Artist")->new_result({ 'name' => 'Depeche Mode' });
-my $new_related_cd = $new_artist->new_related('cds', { 'title' => 'Leave in Silence', 'year' => 1982});
-eval {
-       $new_artist->insert;
-       $new_related_cd->insert;
-};
-is ($@, '', 'Staged insertion successful');
-ok($new_artist->in_storage, 'artist inserted');
-ok($new_related_cd->in_storage, 'new_related_cd inserted');
+{
+    my $new_artist = $schema->resultset("Artist")->new_result({ 'name' => 'Depeche Mode' });
+    my $new_related_cd = $new_artist->new_related('cds', { 'title' => 'Leave in Silence', 'year' => 1982});
+    eval {
+        $new_artist->insert;
+        $new_related_cd->insert;
+    };
+    is ($@, '', 'Staged insertion successful');
+    ok($new_artist->in_storage, 'artist inserted');
+    ok($new_related_cd->in_storage, 'new_related_cd inserted');
+}
 
-
-my $new_cd = $schema->resultset("CD")->new_result({});
-my $new_related_artist = $new_cd->new_related('artist', { 'name' => 'Marillion',});
-lives_ok (
-    sub {
-       $new_related_artist->insert;
-       $new_cd->title( 'Misplaced Childhood' );
-       $new_cd->year ( 1985 );
-       $new_cd->artist( $new_related_artist );  # For exact backward compatibility
-       $new_cd->insert;
-    },
-    'Reversed staged insertion successful'
-);
-ok($new_related_artist->in_storage, 'related artist inserted');
-ok($new_cd->in_storage, 'cd inserted');
+{
+    my $new_cd = $schema->resultset("CD")->new_result({});
+    my $new_related_artist = $new_cd->new_related('artist', { 'name' => 'Marillion',});
+    lives_ok (
+        sub {
+            $new_related_artist->insert;
+            $new_cd->title( 'Misplaced Childhood' );
+            $new_cd->year ( 1985 );
+            $new_cd->artist( $new_related_artist );  # For exact backward compatibility
+            $new_cd->insert;
+        },
+        'Reversed staged insertion successful'
+    );
+    ok($new_related_artist->in_storage, 'related artist inserted');
+    ok($new_cd->in_storage, 'cd inserted');
+}




More information about the Bast-commits mailing list