Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Deliberate failure in Test::More

by ikegami (Patriarch)
on Jun 07, 2010 at 01:47 UTC ( [id://843385]=note: print w/replies, xml ) Need Help??


in reply to Deliberate failure in Test::More

If you wanna test whether an exception was thrown, try to catch one and report whether one was thrown or not.
my $incomplete = eval { Foo->new( first_name => 'Joe', ) }; ok( !$incomplete );

You could be more specific and check whether the right exception was thrown.

You might also like Test::Exception

Replies are listed 'Best First'.
Re^2: Deliberate failure in Test::More
by macrobat (Beadle) on Jun 07, 2010 at 06:53 UTC
    Thanks. I was trying to do that, but somewhere I was spacing out on capturing it. I'll check out Test::Exception.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://843385]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-16 06:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found