From: Robert Klemme Date: 2004-07-30T21:01:46+09:00 Subject: Re: defined? in ruby-1.9 "Dmitry V. Sabanin" schrieb im Newsbeitrag news:200407301939.15247.sdmitry@lrn.ru... > On Friday 30 July 2004 16:31, Robert Klemme wrote: > > "Dmitry V. Sabanin" schrieb im Newsbeitrag > > news:200407301527.31849.sdmitry@lrn.ru... > > > > > On Friday 30 July 2004 15:06, Robert Klemme wrote: > > > > "Dmitry V. Sabanin" schrieb im Newsbeitrag > > > > news:200407301222.10852.sdmitry@lrn.ru... > > > > > > > > > Hi, > > > > > > > > > > Lately I was converting some of my projects to ruby 1.9, and I found > > > > > > > > that this code is no longer working: > > > > > raise if defined?(Test::Unit) > > > > > > > > I guess you intended to write > > > > > > > > raise unless defined? Test::Unit > > > > > > Well, no.. this code is used in exception-catching framework, so the > > > > point is to re-raise exception > > > > > if code is used for tests or to log it if it's in standalone use. > > > > You have test specific code in production code? That sounds odd at > > minimum. Care to uncover some more details? > I agree, but there's no other way to test modules for my web-framework, because it manages > exceptions raised in modules by itself. Ah, I see. > And the only test specific option in production code I > have is that line :) Swear it by Ruby's life, that it's really the only line! :-) (Sorry, the heat might have damaged my brain... ;-)) > Spam Here -> postmaster@sco.com Hehe... robert