From: patrick-may@... (Patrick May) Date: 2002-08-09T05:03:06+09:00 Subject: Testing for mod_ruby (was "how do i mock the presence / absence of a constant w/out getting warnings?") Currently, the only reliable way to test for the mod_ruby enviroment is to look for the constant, as in: if (MOD_RUBY) then ... end or if defined? MOD_RUBY then ... end I am writing unit tested code which needs to behave differently depending on whether MOD_RUBY is present or absent. Currently, such behavior is near impossible to mock, b/c to ruby constants are exactly that -- constant. I can't "undeclare" a top level constant to teardown the MOD_RUBY tests. Perhaps if mod_ruby set a value in the ENV table as a flag this would be easier? Are there any reasons mod_ruby shouldn't set such a flag? Thanks, Patrick