Avdi Grimm wrote:
> == What
> 
> NullDB is a Rails database connection adapter that interprets common
> database operations as no-ops.  It is the Null Object pattern as
> applied to database adapters.
[...]
> == Why
> 
> NullDB is intended to assist in writing fast database-independant unit
> tests for ActiveRecord classes.  For why you would want to test your
> models without the database, see:
> http://www.dcmanges.com/blog/rails-unit-record-test-without-the-database.

I'm not at all convinced that this is a good way of testing (and in my 
experience, ThoughtWorks' software has lots of problems, which could say 
something about their testing practices).  However, assuming for the 
moment that it is good...
[...]
> * It is *not* an in-memory database.  Finds will not work.  Neither
>   will #reload, currently.

So how is this of any use at all?  Normally, when I use tests with 
database operations, I do so to confirm that I'm writing to the database 
what I think I am.  (Sure, I could use RSpec's mocks to test that -- and 
then I wouldn't need NullDB in the first place.)  By removing the 
capability to save records, it seems to me that you've removed any 
utility that this might have had.  Am I missing something?  How do *you* 
find this puppy useful?

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to