- Notifications
You must be signed in to change notification settings - Fork1
Test Mojo log messages from Test::Mojo tests
License
oposs/test-mojo-role-log
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Test::Mojo::Role::Log - test mojo log messages
use Test::Mojo;my$t = Test::Mojo->with_roles('+Log')->new('MyApp');$t->get_ok('/gugus')->log_like(qr{GET "/gugus"})->log_debug_like(qr{GET "/gugus"})->log_info_unlike(qr{GET "/gugus"})->log_debug_like(qr{200 OK.+s.+/s})done_testing();
TheTest::Mojo::Role::Log role enhancesTest::Mojo with additional methods to check log output.
Points to an array with all the log messages issued since the last request.
The roleTest::Mojo::Role::Log adds the following new methods toTest::Mojo ones.
$t->get_ok('/hello') ->log_like(undef,qr{/hello not found},"Request got logged")
Check if the given log message has been issued. All the log messages issued since the start of the current request will get checked.If $logLevel is set to undef the logLevel does not get checked.
Find a trace level log message matching the given $rx.
Find a debug level log message matching the given $rx.
Find a info level log message matching the given $rx.
Find a warn level log message matching the given $rx.
Find a error level log message matching the given $rx.
Find a fatal level log message matching the given $rx.
For each of the methods above there is ac coresponding
Tobias Oetikertobi@oetiker.ch
Copyright 2020, OETIKER+PARTNER AG
Perl Artistic License
About
Test Mojo log messages from Test::Mojo tests
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Contributors3
Uh oh!
There was an error while loading.Please reload this page.