X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F92storage_on_connect_do.t;h=6c467cd54c9b8e939987eb18890dfd4d8b11ab54;hb=d4483998dff1af8eff35b3c5398f564a9a1fb9d8;hp=62712affbab5c41fd2e3dab42cf254d9af088211;hpb=1dafdb2a28c700eabf975685d823036b1b9d69f4;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/92storage_on_connect_do.t b/t/92storage_on_connect_do.t index 62712af..6c467cd 100644 --- a/t/92storage_on_connect_do.t +++ b/t/92storage_on_connect_do.t @@ -1,7 +1,7 @@ use strict; use warnings; -use Test::More tests => 9; +use Test::More tests => 10; use lib qw(t/lib); use base 'DBICTest'; @@ -33,11 +33,11 @@ ok $@, 'Searching for nonexistent table dies'; $schema->storage->disconnect(); -my($connected, $disconnected); +my($connected, $disconnected, @cb_args); ok $schema->connection( DBICTest->_database, { - on_connect_do => sub { $connected = 1 }, + on_connect_do => sub { $connected = 1; @cb_args = @_; }, on_disconnect_do => sub { $disconnected = 1 }, }, ), 'second connection()'; @@ -47,6 +47,7 @@ ok ! $disconnected, 'on_disconnect_do() not called after connect()'; $schema->storage->disconnect(); ok $disconnected, 'on_disconnect_do() called after disconnect()'; +isa_ok($cb_args[0], 'DBIx::Class::Storage', 'first arg to on_connect_do hook'); sub check_exists { my $storage = shift;