From: John Wilger Date: 2006-08-06T01:05:48+09:00 Subject: Re: why can't I catch this exception? On 8/5/06, Rob Sanheim wrote: > And I cannot get the exception to be caught in a test case, no matter > what I do. For example, w/i a standard FooControllerTest: > > def test_bad_file_render_with_full_path_false > assert_raises ActionController::MissingTemplate do > get :bad_file_with_full_path_false > end > rescue Exception => e > flunk("failed") > end > > This just exits - no flunk msg, assert_raise doesn't catch, nothing. If it _is_ raising the exception, you won't reach that rescue -- #assert_raises rescues the exception internally. Perhaps you meant to use #assert_nothing_raised ? -- Regards, John Wilger http://johnwilger.com ----------- Alice came to a fork in the road. "Which road do I take?" she asked. "Where do you want to go?" responded the Cheshire cat. "I don't know," Alice answered. "Then," said the cat, "it doesn't matter." - Lewis Carrol, Alice in Wonderland