Skip Menu |

This queue is for tickets about the Mojolicious-Plugin-ReCAPTCHAv2 CPAN distribution.

Report information
The Basics
Id: 107378
Status: resolved
Priority: 0/
Queue: Mojolicious-Plugin-ReCAPTCHAv2

People
Owner: HJANSEN [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.1
Fixed in: (no value)



Subject: Test suite fails with Mojolicious 6.22
Am Mo 28. Sep 2015, 03:12:55, SREZIC schrieb: Show quoted text
> A sample fail report http://www.cpantesters.org/cpan/report/dc334b60- > 650c-11e5-a1ef-061ee0bfc7aa
That appears to be a consequence of Mojo::JSON 6.22 using JSON::PP boolean constants and it appears to be solely a problem of the tests, not with the module itself. But at first glance I´m not totally convinced that it´s really the tests in Mojolicious::Plugin::ReCAPTCHAv2 which need fixing. The failing tests are written like this: $t ->post_ok( '/test' => {} => form => { 'g-recaptcha-response' => 'foo' } ) ->json_is( '/verify' => 0 ); And then I get: # Failed test 'exact match for JSON Pointer "/verify"' # at t/10-basic.t line 48. # Structures begin differing at: # $got = 0 # $expected = '0' I´d say the test did not expect "'0'"... I could change the test to use ->json_like( '/verify' => qr/0/ ); but I want to think about the problem a bit more before I upload a new version.
On 2015-09-28 04:37:38, HJANSEN wrote: Show quoted text
> Am Mo 28. Sep 2015, 03:12:55, SREZIC schrieb:
> > A sample fail report http://www.cpantesters.org/cpan/report/dc334b60- > > 650c-11e5-a1ef-061ee0bfc7aa
> > That appears to be a consequence of Mojo::JSON 6.22 using JSON::PP > boolean constants and it appears to be solely a problem of the tests, > not with the module itself. > > But at first glance I´m not totally convinced that it´s really the > tests in Mojolicious::Plugin::ReCAPTCHAv2 which need fixing. > The failing tests are written like this: > > $t > ->post_ok( '/test' => {} => form => { 'g-recaptcha-response' => > 'foo' } ) > ->json_is( '/verify' => 0 ); > > And then I get: > > # Failed test 'exact match for JSON Pointer "/verify"' > # at t/10-basic.t line 48. > # Structures begin differing at: > # $got = 0 > # $expected = '0' > > I´d say the test did not expect "'0'"... > I could change the test to use > > ->json_like( '/verify' => qr/0/ ); > > but I want to think about the problem a bit more before I upload a new > version.
Other Mojolicious plugins and Galileo.pm were also affected by the same problem: * https://github.com/jberger/Galileo/issues/47 * https://github.com/jhthorsen/swagger2/issues/38 * https://github.com/oetiker/mojolicious-plugin-pingen/issues/1 Galileo.pm has the following fix: https://github.com/jberger/Galileo/commit/651a833d77b53115482e4083d9b3484dbb74be06
Thanks for the hints. v0.2 should address the compatibility issues and is on it´s way to CPAN.