Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct documention as pointed out in issue #2
Also add a test to ensure the example code in the SYOPSIS works with the released code.
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use Test::More; | ||
use IO::File; | ||
use IO::String; | ||
|
||
|
||
plan tests => 1; | ||
|
||
my $buf = IO::String->new(); | ||
# TODO: automatically extract this from the module? | ||
eval q{ | ||
use Log::Any qw($log); | ||
use Log::Any::Adapter; | ||
# Send all logs to Log::Any::Adapter::FileHandle | ||
Log::Any::Adapter->set('FileHandle', fh=>$buf); | ||
$log->info("Hello world"); | ||
}; | ||
die $@ if $@; | ||
|
||
is(${$buf->string_ref},"[info] Hello world\n", "Testing example in SYOPSIS") | ||
|
||
|