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

Ben Mabey ben at benmabey.com
Sun May 24 01:16:41 EDT 2009


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


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



More information about the rspec-users mailing list