From: nobu.nokada@... Date: 2002-08-12T14:24:59+09:00 Subject: Re: Testing for mod_ruby (was "how do i mock the presence / absence of a constant w/out getting warnings?") Hi, At Mon, 12 Aug 2002 12:06:39 +0900, Patrick May wrote: > assert( defined? MOD_RUBY ) # <= this was true > assert( CGI::Request.mod_ruby? ) # <= this was false? RUNIT::Assert#assert requires true or false exactly, but defined? operator returns string representing object type or nil. This works. def test_parse_with_mod_ruby Object.const_set(:MOD_RUBY, true) assert(!!defined?(MOD_RUBY)) assert(!!CGI::Request.mod_ruby?) end def test_parse_without_mod_ruby assert(!defined?(MOD_RUBY)) assert(!CGI::Request.mod_ruby?) end -- Nobu Nakada