[rspec-users] spec_server errors when reloading fixture replacement pl

Ben Mabey ben at benmabey.com
Mon May 25 01:17:07 EDT 2009

Scott Taylor wrote:
> Ben Mabey wrote:
>> Scott Taylor wrote:
>>> Ben Johnson wrote:
>>>> Did anyone ever figure out the factory_girl / machinist issues? I 
>>>> am having the same problems and can figure out how to fix it for 
>>>> the life of me. The first run works fine, then afterwards I get a 
>>>> bunch of these errors:
>>>> No blueprint for class Venue
>>>> Any ideas? Thanks!
>>> I don't know about Machinist or Factory Girl.  Basically, here's the 
>>> deal:
>>> If those libraries use require instead of load, you are screwed.  
>>> Same goes for autoload'ing.
>> Yep.  You might want to check out Spork[1].  It is a drop-in 
>> replacement for spec_server that uses Kernel.fork instead of 
>> reloading classes to ensure a clean app state.  My coworker, Tim 
>> Harper, wrote it and it has been working great for us so far.   
>> (There is a little setup, so not quite drop-in but it just works with 
>> the --drb flag for rspec.)
>> 1. http://github.com/timcharper/spork/tree/master
>> -Ben
> That's absolutely awesome.
> Have there been any attempts to generalize this, so that mongrel will 
> fork on each request (a la shotgun)?  (I'm still stuck on rails 2.0.2, 
> so a non-rack based reloading scheme would be great).

Well, so Spork was really created with testing in mind.  It is more 
general purpose than spec_server though.  You can use it with any Ruby 
project, not just Rails.  You can also potentially use it with any other 
testing framework that adds support for it (I've been meaning to do this 
for Cucumber).  I know that Tim's original work with Kernel.fork was 
actually dealing with Mongrel but I'm not sure what the exact details of 
it are.  I'll try to find out for you though.


More information about the rspec-users mailing list