[rspec-users] Spec/Test Speed
Scott Taylor
mailing_lists at railsnewbie.com
Sun Oct 7 15:03:48 EDT 2007
On Oct 7, 2007, at 3:01 PM, Ben Mabey wrote:
>
>>
>> The factory method (or attribute_helper) still hits the database. I
>> don't see it as any sort of performance gain. In fact, I've even
>> developed a plugin around the Factory idea, and it was only when I
>> started using it in all of my tests that the speed really started to
>> affect me (I was using mocking/stubbing, with much frustration prior
>> to that point). But to me it's pretty clear the plugin (or the
>> factory) is not the problem - the hit is the database. DHH saw this
>> hit, and since they were using fixtures,he found that creating the
>> fixtures, and then wrapping each test in a transaction was a huge
>> performance gain. I wonder if the same would be true with setups/
>> before(:each)...
>>
>>
>
> Scott,
>
> Where is this factory plugin you speak of?
http://replacefixtures.rubyforge.org/
There is also a screencast at the top of that page. I would highly
advise you watch it.
Scott
More information about the rspec-users
mailing list