"Dmitry V. Sabanin" <sdmitry / lrn.ru> 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 > Throws: > uninitialized constant Test (NameError) > > Ruby 1.8 silently works with that code. So, how do I need to handle this kind of checks in 1.9? > For now as a workaround I changed Test::Unit to Test and it works fine. Why do you test and raise at all? As you see, Ruby throws an exception anyway so why do it yourself? That's one line of code you can spare. Regards robert