>At 10:05 AM 8/31/2005, Ian Phillips wrote:
>For one thing I cannot get it to work.
Exactly. There is no reason to explain how to throw and catch exceptions in
an introduction.
Also, a common coding error (which also occurs several places in watir,
sigh) is to catch more exceptions than you really need to do. The problem
with this is that you may very well catch other kinds of exceptions than
you expecting and so your code is broken, but you aren't getting any error
messages because you trapped them. So you can't figure out what is going wrong.
Fundamentally, rescue blocks hide errors. This is dangerous to do anywhere,
much less in a test suite. It should only be done when there aren't other
choices. In the case of begin/assert expression/rescue, you can always
replace this code with if expression/then and what you get is easier to
understand and has no chance of hiding errors.
Bret
On 8/31/05, Chris McMahon
<<mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]> wrote:
> 3. "begin/assert/rescue" is really a bad idea and we will stop
suggesting it.
I *like* begin/assert/rescue. It's my friend. Why is it a bad idea?
-Chris
_______________________________________________
Wtr-general mailing list
<mailto:[email protected]>[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_____________________
Bret Pettichord
www.pettichord.com
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general