From: Matt S Trout Date: Sat, 20 Jan 2007 21:59:31 +0000 (+0000) Subject: fix Sweet pager test X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9b0d64fc7d7f6e84e31b6a99e57d3c6db8641764;p=dbsrgits%2FDBIx-Class-Historic.git fix Sweet pager test --- diff --git a/t/cdbi-sweet-t/08pager.t b/t/cdbi-sweet-t/08pager.t index 8e94bd9..07166e6 100644 --- a/t/cdbi-sweet-t/08pager.t +++ b/t/cdbi-sweet-t/08pager.t @@ -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( {}, diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index cb3ae57..27c8549 100755 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -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} ) {