NAME
Fennec::Assert::Core::Exception - Functions to test code that throws exceptions
DESCRIPTION
Functions to test code that throws warnings. Emulates Test::Exception.
SYNOPSIS
dies_ok { die( 'xxx' )} "Should die";
lives_ok { 1 } "Should live";
throws_ok { die( 'xxx' )} qr/xxx/, "Throws 'xxx'";
lives_and { ok( 1, "We did not die" )} "Ooops we died";
FUNCTIONS
- lives_ok { ... } $name
-
Test passes if the codeblock does not die.
- dies_ok { ... } $name
-
Test passes if the codeblock dies.
- throws_ok { ... } qr//, $name
-
Test passes if the codeblock dies, and the thrown message matches the regex.
- lives_and { ... } $name
-
Does nothing if the codeblock lives, produces a failed test result if the codeblock dies.
INTERNAL API
FUNCTIONS
- $bool = live_or_die(sub { ... })
- ( $bool, $msg ) = live_or_die(sub { ... })
-
Run a codeblock and check if it lives or dies. In array context will return a boolean, if the code died the error will also be returned. In scalar context only a boolean will be returned.
MANUAL
- Fennec::Manual::Quickstart
-
The quick guide to using Fennec.
- Fennec::Manual::User
-
The extended guide to using Fennec.
- Fennec::Manual::Developer
-
The guide to developing and extending Fennec.
- Fennec::Manual
-
Documentation guide.
AUTHORS
Chad Granum exodist7@gmail.com
COPYRIGHT
Copyright (C) 2010 Chad Granum
Fennec is free software; Standard perl licence.
Fennec is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.