alnewkirk/Plack-Test-Simple — pull request #2 by syohex (2013-07-30 07:47:34+00:00)
Title: Fix case that user installs JSON::XS.

I got following error.
```
% prove -vl t/01-synopsis.t
t/01-synopsis.t ..
ok 1 - use Plack::Test::Simple;
ok 2 - got response for GET /
not ok 3 - GET / successful
not ok 4 - status is 200

# Failed test 'GET / successful'
# at t/01-synopsis.t line 18.

# Failed test 'status is 200'
# at t/01-synopsis.t line 18.
# got: '500'
# expected: '200'
not ok 5 - exact match for data path "/request_uri"
1..5

# Failed test 'exact match for data path "/request_uri"'
# at t/01-synopsis.t line 18.
# got: undef
# expected: '/'
# Looks like you failed 3 tests of 5.
Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/5 subtests

Test Summary Report
-------------------
t/01-synopsis.t (Wstat: 768 Tests: 5 Failed: 3)
Failed tests: 3-5
Non-zero exit status: 3
Files=1, Tests=5, 1 wallclock secs ( 0.01 usr 0.01 sys + 0.09 cusr 0.01 csys = 0.12 CPU)
Result: FAIL
```

And server generates following error message
```
plackup t/apps/env.psgi
HTTP::Server::PSGI: Accepting connections at http://0:5000/
encountered perl type (*main::STDERR,0x1008009) that JSON cannot handle, you might want to report this at /home/syohei/.cpanm/work/1375153254.24924/Plack-Test-Simple-0.000002/t/apps/env.psgi line 7
```

$e has typeglob such as value of 'psgi.errors'. Typeglob cannot be represented
in JSON and JSON::XS throws exception and the test is failed as default.
So this patch set 'allow_unknown'. If 'allow_unknown' is set, JSON::XS does not
throw exception and represent as null for not-represented values.

If user installs only JSON::PP, this test is passed.

Please see this patch.