Skip to content
Snippets Groups Projects
Verified Commit a6bf1fb9 authored by sunpoet's avatar sunpoet
Browse files

devel/p5-Test-Lives: Add p5-Test-Lives 1.003

Test::Lives provides only one function, lives_and, which works almost exactly
like the function of the same name in Test::Exception. That is, it allows you to
test things that could (but shouldn't) throw an exception without having to have
two separate tests with two separate results (and two separate descriptions).

You pass it a block of code to run (which should contain one test assertion) and
a test description to give the assertion inside the block.

The description will be available inside the block in the $_ variable. (This is
different from Test::Exception, which employs hacky magic to relieve you of
having to pass the description to the decorated assertion.)

If the block ends up throwing an exception, a test failure will be logged.

WWW: https://metacpan.org/dist/Test-Lives
parent be9275b0
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment