[rspec-users] RSpec - Testing ActiveRecord addins

Ben Mabey ben at benmabey.com
Thu Jan 29 22:18:12 EST 2009


James Byrne wrote:
> Ben Mabey wrote:
>
>   
>> You can then use the dummy AR classes in your specs with an in-memory 
>> DB.
>>
>> I hope that helps,
>>
>> Ben
>>     
>
> Oh, yes. very much. Especially this example.
>
>   
>> def setup_db
>>   ActiveRecord::Schema.define(:version => 1) do
>>     
>
> Have you, or anyone reading this, had any experience with the nulldb gem 
> as an alternative to in memory sqlite3?
>   
I used nulldb on my last project and I had a lot of success with it.  
Using nulldb comes with tradeoffs though and in this case I would just 
use sqlite.  Unless the project and spec suite is large disconnecting 
the DB may not be worth the effort.

-Ben


More information about the rspec-users mailing list