forked from PerlDancer/Dancer
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes PerlDancer#1006
- Loading branch information
Showing
4 changed files
with
55 additions
and
10 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
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,34 @@ | ||
use strict; | ||
use warnings; | ||
|
||
BEGIN { | ||
use Test::More; | ||
|
||
plan skip_all => 'Devel::Hide required' unless eval 'use Devel::Hide; 1'; | ||
} | ||
|
||
use Devel::Hide 'Clone'; | ||
|
||
plan tests => 3; | ||
|
||
{ | ||
package MyApp; | ||
|
||
use Dancer; | ||
|
||
my $data = { deep => { secret => 'akadabra' } }; | ||
|
||
get '/dump' => sub { Dancer::Error::dumper( $data ) }; | ||
get '/straight' => sub { $data->{deep}{secret} }; | ||
} | ||
|
||
use Dancer::Test; | ||
|
||
|
||
response_content_is '/straight' => 'akadabra', 'secret visible'; | ||
|
||
response_content_like '/dump' => qr/secret.*Hidden/, 'masked by dumper()'; | ||
|
||
response_content_is '/straight' => 'akadabra', '...but not modified'; | ||
|
||
|