Re: Testing functions that access a database

2011-05-08 Thread Nick
On 08/05/11 04:54, Ken Wesson wrote: > Have you considered using a mock object in place of the db? I'm curious to know if there are any good examples of SQL mock-object libraries out there - in any language? The kind of thing which deserves to be emulated. I don't get the impression that there ar

Re: Testing functions that access a database

2011-05-08 Thread Ken Wesson
On Sun, May 8, 2011 at 12:14 PM, Shantanu Kumar wrote: > On May 8, 6:57 pm, Tim McIver wrote: >> @Ken: I looked into mocking a (very little) bit.  I don't have any >> experience with it but I'm worried about the need to sync the 'real' >> database with my mocked functions.  Using the real schema

Re: Testing functions that access a database

2011-05-08 Thread Shantanu Kumar
On May 8, 6:57 pm, Tim McIver wrote: > @Ken: I looked into mocking a (very little) bit.  I don't have any > experience with it but I'm worried about the need to sync the 'real' > database with my mocked functions.  Using the real schema is appealing > because I don't have to worry about synchron

Re: Testing functions that access a database

2011-05-08 Thread Tim McIver
@Ken: I looked into mocking a (very little) bit. I don't have any experience with it but I'm worried about the need to sync the 'real' database with my mocked functions. Using the real schema is appealing because I don't have to worry about synchronization issues. @Shantanu: This looks great! I

Re: Testing functions that access a database

2011-05-08 Thread Shantanu Kumar
On May 8, 8:37 am, Tim McIver wrote: > I'm looking for some input as to the best way to test functions that > interact with a database.  I've just started writing some tests for > functions that read/write to a mysql database (using > clojure.contrib.sql) but my problem is that I'd like the test

Re: Testing functions that access a database

2011-05-07 Thread Ken Wesson
On Sat, May 7, 2011 at 11:37 PM, Tim McIver wrote: > I'm looking for some input as to the best way to test functions that > interact with a database.  I've just started writing some tests for > functions that read/write to a mysql database (using > clojure.contrib.sql) but my problem is that I'd l

Testing functions that access a database

2011-05-07 Thread Tim McIver
I'm looking for some input as to the best way to test functions that interact with a database. I've just started writing some tests for functions that read/write to a mysql database (using clojure.contrib.sql) but my problem is that I'd like the tests to begin with either an empty database or one