Added count, count_related, and tests
[dbsrgits/DBIx-Class-Historic.git] / t / 06relationship.t
index d0ed1c8..d89a0ed 100644 (file)
@@ -1,6 +1,6 @@
 use Test::More;
 
-plan tests => 7;
+plan tests => 8;
 
 use lib qw(t/lib);
 
@@ -26,6 +26,13 @@ $artist->create_related( 'cds', {
 } );
 is( ($artist->search_related('cds'))[3]->title, 'Big Flop', 'create_related ok' );
 
+# count_related
+is( $artist->count_related('cds'), 4, 'count_related ok' );
+
+SKIP: {
+
+  #skip "Relationship with invalid cols not yet checked", 1;
+
 # try to add a bogus relationship using the wrong cols
 eval {
     $artist->add_relationship(
@@ -33,7 +40,9 @@ eval {
         { 'foreign.cd' => 'self.cdid' }
     );
 };
-like($@, qr/no such accessor/, 'failed when creating a rel with invalid key, ok');
+like($@, qr/Unknown column/, 'failed when creating a rel with invalid key, ok');
+
+} # End SKIP block
 
 # another bogus relationship using no join condition
 eval {