Forum: Ruby on Rails Testing class variables

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
5b4cc2b3895cc34e3bcef32025c3cafd?d=identicon&s=25 Jonathan Leighton (Guest)
on 2005-12-28 01:23
(Received via mailing list)
I recently had a bug where a class variable was being initialised

@@var1 = nil, @@var2 = nil

instead of:

@@var1, @@var2 = nil

In investigating this, I realised that in a unit test, class variables
do not get "reloaded" between tests like everything else. Is there any
way to make them "reload" (I would have though given the nature of tests
that would be the default behaviour).

Many Thanks

Jonathan Leighton | |
This topic is locked and can not be replied to.