From: Nobuyoshi Nakada Date: 2004-12-29T09:40:12+09:00 Subject: Re: unit testing of methods which do Kernel#exit Hi, At Wed, 29 Dec 2004 07:56:16 +0900, Michal wrote in [ruby-talk:124685]: > I ran into a problem -- how to unit test methods that have > Kernel#exit call in case of troubles (fatal errors). > > I found solution (imho) better than changing behaviour > of Kernel.exit -- I simply raise SystemExit, exitcode ... Kernel.exit does it too, so you can catch "exit" by `rescue SystemExit'. -- Nobu Nakada