Assert_throws

P

Peter Fitzgibbons

------_=_NextPart_001_01C5B7CE.C8CB715E
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hello all,
=20
Can someone lead me to a reference for assert_throws? I don't
understand how to reference the expected symbol.
=20
I'm trying to assert that a bad call on WIN32OLE object throws
WIN32OLERuntimeException.
=20
Thanks.
=20
Peter J. Fitzgibbons
Applications Manager
Lakewood Homes - "The American Dream Builder"(r)
(e-mail address removed)
(847) 884-8800=20
=20
=20

------_=_NextPart_001_01C5B7CE.C8CB715E--
 
E

Eric Hodel

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.
 
J

James Edward Gray II

I believe you are looking for:

assert_raise(WIN32OLERuntimeException) { bad_call_goes_here() }

Throw/catch are a non-exception related Ruby idiom.

Hope that helps.

James Edward Gray II
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top