NAME
Fennec::Assert::Core::Warn - Tools for testing warnings
DESCRIPTION
This library provides functions that are useful in testing code that throws warnings. This library provides everything Test::Warn does plus some bonuses.
SYNOPSIS
my @warnings = capture_warnings {
warn 'a';
warn 'b';
};
warning_is { warn 'xxx' } "xxx at ...", "Name";
warnings_are { warn 'xxx'; warn 'yyy'; }
[ 'xxx at ...', 'yyy at ...' ],
"Name";
warning_like { warn 'xxx' } qr/^xxx at/, "Name";
warnings_like { warn 'xxx'; warn 'yyy' }
[ qr/^xxx/, qr/^yyy/ ],
"Name";
warnings_exist { warn 'xxx'; warn 'yyy' }
[ qr/^xxx/, 'yyy at ...' ],
"Name";
EXPORTS
- @list = capture_warnings { warn 'xxx' }
-
Capture the generated warnings to do with as you please.
- warning_is { ... } $want, $name
-
Check that the thrown warning is what you want.
- warnings_are { ... } \@want, $name
-
Check that the thrown warnings are what you want.
- warning_like { ... } $regex, $name
-
Check that the thrown warning matches $regex.
- warnings_like { ... } [ $regex, ... ], $name
-
Check that the thrown warnings match the list of regexes.
- warnings_exist { ... } [ $string, $regex, ... ], $name
-
Check that at least 1 warning matches for each string and regex provided.
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.