fix Sweet pager test
Matt S Trout [Sat, 20 Jan 2007 21:59:31 +0000 (21:59 +0000)]
t/cdbi-sweet-t/08pager.t
t/lib/DBICTest.pm

index 8e94bd9..07166e6 100644 (file)
@@ -19,9 +19,9 @@ use_ok('DBICTest');
 
 DBICTest::Schema::CD->load_components(qw/CDBICompat CDBICompat::Pager/);
 
-my $schema = DBICTest->init_schema();
+my $schema = DBICTest->init_schema(compose_connection => 1);
 
-#DBICTest::CD->result_source_instance->schema->storage($schema->storage);
+DBICTest::CD->result_source_instance->schema->storage($schema->storage);
 
 my ( $pager, $it ) = DBICTest::CD->page(
     {},
index cb3ae57..27c8549 100755 (executable)
@@ -55,7 +55,11 @@ sub init_schema {
     my $dbuser = $ENV{"DBICTEST_DBUSER"} || '';
     my $dbpass = $ENV{"DBICTEST_DBPASS"} || '';
 
-    my $schema = DBICTest::Schema->compose_namespace('DBICTest')
+    my $compose_method = ($args{compose_connection}
+                           ? 'compose_connection'
+                           : 'compose_namespace');
+
+    my $schema = DBICTest::Schema->$compose_method('DBICTest')
                                  ->connect($dsn, $dbuser, $dbpass);
     $schema->storage->on_connect_do(['PRAGMA synchronous = OFF']);
     if ( !$args{no_deploy} ) {