Bod has asked for the wisdom of the Perl Monks concerning the following question:
I've released a new version of Business::Stripe::Webhook with a modified constructor following the discussion about STDIN typeglob
At the same time I have added some extra, more thorough tests. All the tests pass as expected here locally but now it has reached CPAN Testers, I have a failure. I can usually work out why something is failing from the diagnostic information...but I cannot see the problem in this case. Can you help please?
This is the CPAN Tester Report and this is the test file:
Any help (or general help with improving tests) would be very welcome...#!perl use 5.010; use strict; use warnings; use Test::More; use Business::Stripe::Webhook; #plan tests => 3; my $count = 0; print "\n"; my $payload; read(DATA, $payload, 10000); my $webhook_fail = Business::Stripe::Webhook->new( signing_secret => 'whsec_...', 'payload' => $payload, 'invoice-paid' => \&pay_invoice, ); $webhook_fail->process(); ok( !$webhook_fail->success, "Signature error" ); my $signing_secret = 'whsec_12345ABCDEFGHIJKLM'; $ENV{'HTTP_STRIPE_SIGNATURE'} = 't=ABCDEFGHIJ,v1=917fd62f6828ceb0509ae +bd9ee94e4c455887b6c174ef94037e089265c8c575c'; my $webhook_pass = Business::Stripe::Webhook->new( signing_secret => $signing_secret, 'payload' => $payload, 'invoice-paid' => \&pay_invoice, ); $webhook_pass->process(); ok( $webhook_pass->success, "Signature pass" ); sub pay_invoice { is( $_[0]->{'object'}, 'event', "pay.invoice handled - " . ++$coun +t ); } done_testing($count + 2); __DATA__ { "id": "evt_1NFK32EfkkexSbWLZb6LoEap", "object": "event", "api_version": "2020-08-27", "data": { ... bigger JSON object ... } }
edited - to correct typo in module link
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Test failing during CPAN Testing
by bliako (Abbot) on Jun 19, 2023 at 18:28 UTC | |
by Bod (Parson) on Jun 19, 2023 at 22:05 UTC | |
by afoken (Chancellor) on Jun 19, 2023 at 22:15 UTC | |
by Bod (Parson) on Jun 19, 2023 at 22:24 UTC | |
by eyepopslikeamosquito (Archbishop) on Jun 20, 2023 at 08:42 UTC | |
by choroba (Cardinal) on Jun 20, 2023 at 08:36 UTC | |
by Bod (Parson) on Jul 01, 2023 at 19:43 UTC | |
by ikegami (Patriarch) on Jun 20, 2023 at 03:54 UTC | |
by eyepopslikeamosquito (Archbishop) on Jun 20, 2023 at 06:32 UTC | |
Re: Test failing during CPAN Testing
by bliako (Abbot) on Jun 20, 2023 at 07:53 UTC | |
by Bod (Parson) on Jun 20, 2023 at 15:31 UTC | |
Re: Test failing during CPAN Testing
by Bod (Parson) on Jun 18, 2023 at 22:08 UTC | |
Re: Test failing during CPAN Testing
by Bod (Parson) on Jun 19, 2023 at 15:58 UTC |