Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Test Mojo log messages from Test::Mojo tests

License

NotificationsYou must be signed in to change notification settings

oposs/test-mojo-role-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test::Mojo::Role::Log - test mojo log messages

SYNOPSIS

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();

DESCRIPTION

TheTest::Mojo::Role::Log role enhancesTest::Mojo with additional methods to check log output.

ATTRIBUTES

logCache

Points to an array with all the log messages issued since the last request.

METHODS

The roleTest::Mojo::Role::Log adds the following new methods toTest::Mojo ones.

log_like($rx,$desc)

$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.

log_trace_like($rx,$desc) (if mojo supports it)

Find a trace level log message matching the given $rx.

log_debug_like($rx,$desc)

Find a debug level log message matching the given $rx.

log_info_like($rx,$desc)

Find a info level log message matching the given $rx.

log_warn_like($rx,$desc)

Find a warn level log message matching the given $rx.

log_error_like($rx,$desc)

Find a error level log message matching the given $rx.

log_fatal_like($rx,$desc)

Find a fatal level log message matching the given $rx.

*_unlike

For each of the methods above there is ac coresponding

AUTHOR

Tobias Oetikertobi@oetiker.ch

COPYRIGHT

Copyright 2020, OETIKER+PARTNER AG

LICENSE

Perl Artistic License

About

Test Mojo log messages from Test::Mojo tests

Topics

Resources

License

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp