From: Peter Rabbitson <ribasushi@cpan.org>
Date: Thu, 29 Jan 2009 08:44:25 +0000 (+0000)
Subject: Backporting uncovered an incomplete test
X-Git-Tag: v0.08240~163
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=181c0934308d8359a6fa194eeb9986b92795819f;p=dbsrgits%2FDBIx-Class.git

Backporting uncovered an incomplete test
---

diff --git a/t/99dbic_sqlt_parser.t b/t/99dbic_sqlt_parser.t
index 6acd7ba..b6683fb 100644
--- a/t/99dbic_sqlt_parser.t
+++ b/t/99dbic_sqlt_parser.t
@@ -14,12 +14,13 @@ BEGIN {
 }
 
 my $schema = DBICTest->init_schema();
-plan tests => ($schema->sources * 3);
+my @sources = grep { $_ ne 'Dummy' } ($schema->sources); # Dummy was yanked out by the sqlt hook test
+plan tests => ( @sources * 3);
 
 { 
 	my $sqlt_schema = create_schema({ schema => $schema, args => { parser_args => { } } });
 
-	foreach my $source ($schema->sources) {
+	foreach my $source (@sources) {
 		my $table = $sqlt_schema->get_table($schema->source($source)->from);
 
 		my $fk_count = scalar(grep { $_->type eq 'FOREIGN KEY' } $table->get_constraints);
@@ -33,7 +34,7 @@ plan tests => ($schema->sources * 3);
 { 
 	my $sqlt_schema = create_schema({ schema => $schema, args => { parser_args => { add_fk_index => 1 } } });
 
-	foreach my $source ($schema->sources) {
+	foreach my $source (@sources) {
 		my $table = $sqlt_schema->get_table($schema->source($source)->from);
 
 		my $fk_count = scalar(grep { $_->type eq 'FOREIGN KEY' } $table->get_constraints);
@@ -47,7 +48,7 @@ plan tests => ($schema->sources * 3);
 { 
 	my $sqlt_schema = create_schema({ schema => $schema, args => { parser_args => { add_fk_index => 0 } } });
 
-	foreach my $source ($schema->sources) {
+	foreach my $source (@sources) {
 		my $table = $sqlt_schema->get_table($schema->source($source)->from);
 
 		my @indices = $table->get_indices;
diff --git a/t/lib/DBICTest/Schema.pm b/t/lib/DBICTest/Schema.pm
index 857050f..11157f2 100644
--- a/t/lib/DBICTest/Schema.pm
+++ b/t/lib/DBICTest/Schema.pm
@@ -40,6 +40,7 @@ __PACKAGE__->load_classes(qw/
     'ArtistSubclass',
     'Producer',
     'CD_to_Producer',
+    'Dummy',    # this is a real result class we remove in the hook below
   ),
   qw/SelfRefAlias TreeLike TwoKeyTreeLike Event EventTZ NoPrimaryKey/,
   qw/Collection CollectionObject TypedObject Owners BooksInLibrary/,