restore mk_classaccessor
[dbsrgits/DBIx-Class.git] / t / 101populate_rs.t
index 39b59b9..5ea3a55 100644 (file)
@@ -8,7 +8,6 @@
 ## Also need to test some stuff that should generate errors.
 ## ----------------------------------------------------------------------------
 
-
 use strict;
 use warnings;
 
@@ -16,7 +15,8 @@ use Test::More;
 use lib qw(t/lib);
 use DBICTest;
 
-plan tests => 53;
+plan tests => 98;
+
 
 ## ----------------------------------------------------------------------------
 ## Get a Schema and some ResultSets we can play with.
@@ -320,7 +320,10 @@ VOID_CONTEXT: {
                ok( $formerly->name eq 'VOID_PK_Formerly Named', "Got Correct name for result object");
                
                ## Create the expected children sub objects?
-               use Data::Dump qw/dump/;
+               ok( $crap->can('cds'), "Has cds relationship");
+               ok( $girl->can('cds'), "Has cds relationship");
+               ok( $damn->can('cds'), "Has cds relationship");
+               ok( $formerly->can('cds'), "Has cds relationship");
                
                ok( $crap->cds->count == 0, "got Expected Number of Cds");
                ok( $girl->cds->count == 2, "got Expected Number of Cds");      
@@ -377,9 +380,7 @@ VOID_CONTEXT: {
 
                ## Test from a belongs_to perspective, should create artist first, 
                ## then CD with artistid.
-               
-               diag("Starting Void Context BelongsTO with No PKs");
-               
+                               
                my $cds = [
                        {
                                title => 'Some CD3BB',
@@ -416,8 +417,6 @@ VOID_CONTEXT: {
        
                ## This first group of tests checks to make sure we can call populate
                ## with the parent having many children and let the keys be automatic
-               
-               diag("Starting Void Context Has Many with No PKs");
 
                my $artists = [
                        {       
@@ -470,9 +469,10 @@ VOID_CONTEXT: {
                ok( $formerly->name eq 'VOID_Formerly Named', "Got Correct name for result object");
                
                ## Create the expected children sub objects?
-               use Data::Dump qw/dump/;
-               
-               warn dump map { $_->get_columns } $damn->cds;
+               ok( $crap->can('cds'), "Has cds relationship");
+               ok( $girl->can('cds'), "Has cds relationship");
+               ok( $damn->can('cds'), "Has cds relationship");
+               ok( $formerly->can('cds'), "Has cds relationship");
                
                ok( $crap->cds->count == 0, "got Expected Number of Cds");
                ok( $girl->cds->count == 2, "got Expected Number of Cds");      
@@ -482,30 +482,11 @@ VOID_CONTEXT: {
                ## Did the cds get expected information?
                
                my ($cd1, $cd2) = $girl->cds->search({},{order_by=>'year ASC'});
-               
+
+               ok($cd1, "Got a got CD");
+               ok($cd2, "Got a got CD");
                ok( $cd1->title eq "VOID_My First CD", "Got Expected CD Title");
                ok( $cd2->title eq "VOID_Yet More Tweeny-Pop crap", "Got Expected CD Title");
        }
 
-}
-
-__END__
-## ----------------------------------------------------------------------------
-## Error cases
-## ----------------------------------------------------------------------------
-
-SHOULD_CAUSE_ERRORS: {
-
-       ## bad or missing PKs
-       ## changing columns
-       ## basically errors for non well formed data
-       ## check for the first incomplete problem
-       ## can we solve the problem of void context and no PKs?
-
-}
-
-
-
-
-
-
+}
\ No newline at end of file