Spork: how to refresh validations and other code?

前端 未结 4 813
广开言路
广开言路 2020-12-28 07:54

I\'ve been using spork all day, and most of the time it is a really great.

However, I am often running into a few problems where I need to restart Spork in order for

4条回答
  •  时光取名叫无心
    2020-12-28 08:31

    From http://www.rubyinside.com/how-to-rails-3-and-rspec-2-4336.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+RubyInside+%28Ruby+Inside%29 :

    A minor snafu will remain, though. If you update app/models/person.rb, the change won't take effect in your tests since Spork has the old Person still in memory. One way around this is to edit config/environments/test.rb and change:

    config.cache_classes = true
    

    To:

    config.cache_classes = false
    

提交回复
热议问题