From: Peter Rabbitson Date: Sat, 3 Oct 2009 13:55:25 +0000 (+0000) Subject: Add failing tests for RT#50003 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=46bb50b7733b8dcb09800acd2920940a3e2c8edc;p=dbsrgits%2FDBIx-Class-Historic.git Add failing tests for RT#50003 --- diff --git a/t/storage/on_connect_call.t b/t/storage/on_connect_call.t index 880fa3b..12894ee 100644 --- a/t/storage/on_connect_call.t +++ b/t/storage/on_connect_call.t @@ -10,7 +10,7 @@ use DBIx::Class::Storage::DBI; # !!! do not replace this with done_testing - tests reside in the callbacks # !!! number of calls is important -use Test::More tests => 11; +use Test::More tests => 15; # !!! my $schema = DBICTest::Schema->clone; @@ -78,3 +78,20 @@ my $schema = DBICTest::Schema->clone; $schema->storage->ensure_connected; $schema->storage->disconnect; # this should not fire any tests } + +{ + ok $schema->connection( + sub { DBI->connect(DBICTest->_database) }, + { + # method list form + on_connect_call => [ sub { ok 1, "on_connect_call after DT parser" }, ], + on_disconnect_call => [ sub { ok 1, "on_disconnect_call after DT parser" }, ], + }, + ), 'connection()'; + + ok (! $schema->storage->connected, 'start disconnected'); + my $parser = $schema->storage->datetime_parser; + + $schema->storage->ensure_connected; + $schema->storage->disconnect; +}