From: Peter Rabbitson Date: Fri, 4 Sep 2009 06:51:30 +0000 (+0000) Subject: Proper unconnected test X-Git-Tag: v0.08111~14^2~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=465cdd3fe2a505adc044b98621b295872fde16d4;p=dbsrgits%2FDBIx-Class.git Proper unconnected test --- diff --git a/t/72pg.t b/t/72pg.t index e4d1fd8..7889798 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -32,7 +32,7 @@ DBICTest::Schema->load_classes( map {s/.+:://;$_} @test_classes ) if @test_class ok (!$s->storage->_dbh, 'definitely not connected'); # Check that datetime_parser returns correctly before we explicitly connect. - SKIP: { + SKIP: { eval { require DateTime::Format::Pg }; skip "DateTime::Format::Pg required", 2 if $@; @@ -43,9 +43,14 @@ DBICTest::Schema->load_classes( map {s/.+:://;$_} @test_classes ) if @test_class is( $parser, 'DateTime::Format::Pg', 'datetime_parser is as expected'); } - + ok (!$s->storage->_dbh, 'still not connected'); +} +{ + my $s = DBICTest::Schema->connect($dsn, $user, $pass); # make sure sqlt_type overrides work (::Storage::DBI::Pg does this) + ok (!$s->storage->_dbh, 'definitely not connected'); is ($s->storage->sqlt_type, 'PostgreSQL', 'sqlt_type correct pre-connection'); + ok (!$s->storage->_dbh, 'still not connected'); } ### connect, create postgres-specific test schema