Assert_throws

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.

Thanks for your help!

Peter J. Fitzgibbons
Applications Manager
Lakewood Homes - "The American Dream Builder"(r)
Peter.Fitzgibbons@Lakewoodhomes.net
(847) 884-8800

···

-----Original Message-----
From: Eric Hodel [mailto:drbrain@segment7.net]
Sent: Monday, September 12, 2005 2:23 PM
To: ruby-talk ML
Subject: Re: Assert_throws

On 12 Sep 2005, at 12:18, Peter Fitzgibbons wrote:

Hello all,

Can someone lead me to a reference for assert_throws? I don't
understand how to reference the expected symbol.

I'm trying to assert that a bad call on WIN32OLE object throws
WIN32OLERuntimeException.

You want assert_raises. Exceptions are raised, Objects are thrown.

--

FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

I don't see it marked as deprecated in 1.9:

$ cat test.rb
require 'test/unit'

class T < Test::Unit::TestCase
   def test_assert_raises
     assert_raises RuntimeError do raise end
   end
end

$ ruby -vw test.rb
ruby 1.8.3 (2005-06-17) [powerpc-darwin8.1.0]
Loaded suite test
Started
.
Finished in 0.003145 seconds.

1 tests, 1 assertions, 0 failures, 0 errors

···

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.

--
Eric Hodel - drbrain@segment7.net - http://segment7.net
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04