From: Eric Hodel Date: 2005-09-13T05:51:24+09:00 Subject: assert_raises From ruby-talk 155793 On 12 Sep 2005, at 12:27, Peter Fitzgibbons wrote: > Ok. I just read assert_raises is deprecated in 1.9 and will be > deleted > in 2.0... I guess I was worried for the future and didn't understand. > Is there extended documentation somewhere on this. The pickaxe > doesn't > go into assert_raises/assert_throws. If its truly deprecated, I'd expect it to warn me about it. It doesn't: $ cat test.rb require 'test/unit' class T < Test::Unit::TestCase def test_assert_raises assert_raises RuntimeError do raise end end end $ ruby19 -vw test.rb ruby 1.9.0 (2005-09-13) [powerpc-darwin8.2.0] Loaded suite test Started . Finished in 0.003098 seconds. 1 tests, 1 assertions, 0 failures, 0 errors I'd also expect it to be deprecated in a stable release so my tests don't start breaking once I make a major jump. Most people will never run their code under 1.9 and be very confused when their assertions just die without explanation. If assert_raises is removed the tenses won't match up sensibly. raise assertions won't match past/future: assert_raise <-> assert_nothing_raised but throw assertions will: assert_throws <-> assert_nothing_thrown (Personally, I'd like to see some deny_ methods in there, assert_raises/deny_raises.) -- Eric Hodel - drbrain@segment7.net - http://segment7.net FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04