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

Scott Taylor scott at railsnewbie.com
Sun May 24 05:30:54 EDT 2009


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).

Scott


>
>
>>
>> If those libraries internally use load, or load_dependency, and you 
>> have cache_classes = false in your dev env, you could try manually 
>> reloading it.
>> Here's FixtureReplacement in script/console (@ version 2.1) after 
>> reload! is called:
>>
>> http://gist.github.com/116422
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list