Author: timbo
Date: Thu Oct 29 16:39:28 2009
New Revision: 13457

Modified:
   dbi/trunk/t/70callbacks.t

Log:
Added some more ChildCallbacks tests


Modified: dbi/trunk/t/70callbacks.t
==============================================================================
--- dbi/trunk/t/70callbacks.t   (original)
+++ dbi/trunk/t/70callbacks.t   Thu Oct 29 16:39:28 2009
@@ -169,9 +169,9 @@
 # --- test ChildCallbacks.
 %called = ();
 $args[-1] = {
-    Callbacks => {
+    Callbacks => my $dbh_callbacks = {
         ping => sub { $called{ping}++; return; },
-        ChildCallbacks => {
+        ChildCallbacks => my $sth_callbacks = {
             execute => sub { $called{execute}++; return; },
             fetch   => sub { $called{fetch}++; return; },
         }
@@ -182,10 +182,13 @@
 ok $dbh->ping, 'Ping';
 is $called{ping}, 1, 'Ping callback should have been called';
 ok my $sth = $dbh->prepare('SELECT name from t'), 'Prepare a statement handle 
(child)';
+ok $sth->{Callbacks}, 'child should have Callbacks';
+is $sth->{Callbacks}, $sth_callbacks, "child Callbacks should be 
ChildCallbacks of parent"
+    or diag "(dbh Callbacks is $dbh_callbacks)";
 ok $sth->execute, 'Execute';
 is $called{execute}, 1, 'Execute callback should have been called';
 ok $sth->fetch, 'Fetch';
-is $called{execute}, 1, 'Fetch callback should have been called';
+is $called{fetch}, 1, 'Fetch callback should have been called';
 
 __END__
 

Reply via email to