Permalink
Browse files

Fix DBD::Mock::Session->verify_bound_params to check for state exhaus…

…tion
  • Loading branch information...
1 parent 3a1d41b commit 179e83aad9d4498a76bee49225ba596fdaf99ca6 wu-lee committed Mar 30, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/DBD/Mock.pm
View
@@ -1246,6 +1246,9 @@ sub verify_statement {
sub verify_bound_params {
my ($self, $dbh, $params) = @_;
+ ($self->has_states_left)
+ || die "Session states exhausted, only '" . scalar(@{$self->{states}}) . "' in DBD::Mock::Session (" . $self->{name} . ")";
+
my $current_state = $self->current_state;
if (exists ${$current_state}{bound_params}) {
my $expected = $current_state->{bound_params};

0 comments on commit 179e83a

Please sign in to comment.