[rspec-users] rails memoize and reload class => error raised

Justin Ko jko170 at gmail.com
Fri Feb 3 18:56:22 EST 2012


On Feb 3, 2012, at 3:29 PM, apneadiving wrote:

> Hi,
> 
> That's a bit off topic but since I use Spork + Rspec...
> 
> Well, my classes are reloaded between each test wave so Rails'
> "memoize" method raises an error (which is expected, see code:
> http://rubydoc.info/docs/rails/3.0.0/ActiveSupport/Memoizable:memoize)
> 
> Anyone resolved this issue with an elegant solution?
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

Don't use #memoize, use `||=`



More information about the rspec-users mailing list