forked from plainblack/Lacuna-Server-Open
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
151d281
commit 982c914
Showing
2 changed files
with
51 additions
and
0 deletions.
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,33 @@ | ||
use lib '/data/Lacuna-Server/lib'; | ||
|
||
use Test::More; | ||
use Log::Any::Test; | ||
use Log::Any qw/$log/; | ||
|
||
use Plack::Builder; | ||
use Plack::Test; | ||
use HTTP::Request::Common; | ||
|
||
use_ok 'Plack::Middleware::LightProfile'; | ||
|
||
my $base_app = sub { return [ 200, [], ['Body'] ]; }; | ||
|
||
my $app = builder { | ||
enable 'LightProfile'; | ||
$base_app; | ||
}; | ||
|
||
test_psgi | ||
app => $app, | ||
client => sub { | ||
my $cb = shift; | ||
my $res = $cb->(GET "/"); | ||
is $res->code, 200, 'Call succeeded'; | ||
is $res->content, 'Body', '... returned correct content'; | ||
} | ||
; | ||
|
||
$log->contains_ok(qr/response time: \d.\d+ end memory: \d+ added memory: \d+/, 'Logged memory and time data'); | ||
$log->empty_ok('Only one message in the log'); | ||
|
||
done_testing; |