candlerb / snailgun

Preload and fork ruby interpreter for fast script startup
68 stars 7 forks source link

Problems with class reloading if factory_girl is being used #10

Open tobsch opened 13 years ago

tobsch commented 13 years ago

Hi there,

we had a problem with several models that weren't reloaded properly. I just traced it down and it's the funny combination snailgun & factory_girl:

If you use factory_girl and load in in test_helper, all models are being loaded by snailgun because it manually requires test_helper. If you disable loading test helper everything works fine.

Best,

Tobias

candlerb commented 13 years ago

If you can make a patch which fixes this, I'll commit it. I'm afraid I don't know what it would be about factory_girl which would cause test_helper to preload all models.

Is this a rails app? You do have config.cache_classes = false in config/environments/test.rb ?

phoet commented 13 years ago

Any feedback on this?

I'm experiencing similar issue without using factory girl.

(Some) Models seem to not get reloaded while other Classes like Tests or Helpers.