execute_array() #2

Merged
merged 7 commits into from Oct 10, 2012

Conversation

Projects
None yet
4 participants
@chiselwright

We've recently started using DBI's execute_array() at work.

Out testing used DBD::Mock which doesn't support execute_array().

This set of commits adds the failing test, then implements execute_array() in DBD::Mock.

The testing is a bit sparse, but should be easy enough to extend as and when other users of the module require it.

Behaviour is as we (currently) expect from our test suite with this addition.

chiselwright added some commits Sep 27, 2012

Add git-repo url to meta-data
This saves people hunting around github on the offchange that there's a
git-repo of the project. Now it's in the meta data and should be a lot easier
for people to find.
Add failing test for execute_array()
This is something we've tried using, and hence mocking in tests at $work
recently.
This script fails with the same error we're seeing, so is a good starting
point for adding the functionality:

    $ prove -lv t/030_st_execute_array.t
    t/030_st_execute_array.t ..
    ok 1 - use DBD::Mock;
    ok 2 - use DBI;
    DBD::Mock::st execute_array failed: 3 bind values supplied but 0 expected at t/030_st_execute_array.t line 28.
    not ok 3 - Called execute_array() ok

    #   Failed test 'Called execute_array() ok'
    #   at t/030_st_execute_array.t line 30.
    1..3
    # Looks like you failed 1 test of 3.
    Dubious, test returned 1 (wstat 256, 0x100)
    Failed 1/3 subtests
Add bind_param_array() method
This seems to behave the same as bind_param() in our mocked world, so we just
pass the call on.
Add execute_array() method to DBD::Mock::st
This is an early prototype that no longer dies when we call execute_array() on
a mocked $dbh - but the testing doesn't yet have very high coverage to prove
that it behaves as expected.
@shlomif

This comment has been minimized.

Show comment Hide comment
@ginesr

This comment has been minimized.

Show comment Hide comment
@ginesr

ginesr Oct 10, 2012

Collaborator

@bluescreen10 i'm merging this change, looks good to me!

Collaborator

ginesr commented Oct 10, 2012

@bluescreen10 i'm merging this change, looks good to me!

ginesr added a commit that referenced this pull request Oct 10, 2012

@ginesr ginesr merged commit efc9492 into bluescreen10:master Oct 10, 2012

@bluescreen10

This comment has been minimized.

Show comment Hide comment
@bluescreen10

bluescreen10 Oct 22, 2012

Owner

Thanks for the patch. I've uploaded today version 1.45 of DBD::Mock to CPAN
hopefully future fixes won't need to wait so long :D

On Tue, Oct 9, 2012 at 3:12 PM, Shlomi Fish notifications@github.comwrote:

@chiselwright https://github.com/chiselwright : see Rob Kinyon's
comment here -
http://blogs.perl.org/users/chisel/2012/10/dbdmock-still-maintained.html .


Reply to this email directly or view it on GitHubhttps://github.com/bluescreen10/dbd-mock/pull/2#issuecomment-9277165.

Owner

bluescreen10 commented Oct 22, 2012

Thanks for the patch. I've uploaded today version 1.45 of DBD::Mock to CPAN
hopefully future fixes won't need to wait so long :D

On Tue, Oct 9, 2012 at 3:12 PM, Shlomi Fish notifications@github.comwrote:

@chiselwright https://github.com/chiselwright : see Rob Kinyon's
comment here -
http://blogs.perl.org/users/chisel/2012/10/dbdmock-still-maintained.html .


Reply to this email directly or view it on GitHubhttps://github.com/bluescreen10/dbd-mock/pull/2#issuecomment-9277165.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment