Uri Guttman wrote:
>>>>>> "SB" == Steve Bertrand <st...@ibctech.ca> writes:
> 
>   SB> I thought afterword that it had to do with precedence. I'll stick to
>   SB> using brackets when I know I need the left side evaluated before moving
>   SB> forward.
> 
> you don't need parens (those aren't brackets, [] are brackets, {} are
> braces)

Usually I'm decently clueful when stating the difference between
parenthesis, braces and brackets, so pardon my err.. thanks for the kick ;)

> for that, just use the proper op eq and you get a better test
> and the op is faster and binds better.

Ok.

>   SB> I don't want to change the object method's behaviour just for a test, so
>   SB> can anyone point me in the right direction as to how I can override the
>   SB> object method's needed die() statement on the test side, so the method
>   SB> I'm testing doesn't die() the test?
> 
> you need to wrap the call in block eval and check for die
> afterwards. see perldoc -f eval and perlvar for $...@. note that this is
> BLOCK eval which is fine to use anywhere you want to trap dies and not
> string eval which is evil unless absolutely necessary.
> 
>   SB> is ($user->add_plan(\%plan_info), 0, "Don't want to die()!");
> 
>       eval { $user->add_plan(\%plan_info) } ;
> 
>       is( $@, .... ) ;

Thanks. I've been toying around with such, but I think I'm at the point
where I've read too much ahead in the books without putting things into
practise enough to retain practical experience.

I'll have another go at it.

Cheers,

Steve

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to