From: Ricardo Signes Date: Thu, 8 Jan 2009 20:49:29 +0000 (+0000) Subject: failing test for callback on_connect_do getting storage obejct X-Git-Tag: v0.08240~205 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=abe38018ae1db9895bac713a808fbde688434c15;p=dbsrgits%2FDBIx-Class.git failing test for callback on_connect_do getting storage obejct --- 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;