[LRUG] Defining constants in ActiveSupport::TestCase ?

Taryn East teast at globalpersonals.co.uk
Fri Aug 21 01:20:16 PDT 2009


So - we have a few constants we use in testing. They're used for both
functional and integration tests (and some of the unit tests too), so we've
pulled them into ActiveSupport::TestCase in a test helper file.

This works fine when you run, say, just "rake test:X" (where X is
units/functionals etc), but when you run just "rake test" it complains that
I've defined them twice.

We've since added an "if defined?(CONST_NAME)" to the end of each one -
which cuts the warnings nicely... but I was thinking that surely there's a
way to make sure that it's all only loaded once.

Does anybody know?

thanks in advance,
Taryn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20090821/d7b32565/attachment-0003.html>


More information about the Chat mailing list