in reply to Re: STDIN typeglob
in thread STDIN typeglob

it would probably help to have some idea of what tests you intend to run

Thanks kcott,

eyepopslikeamosquito identified the new method in this comment - Re^3: STDIN typeglob

The test I am trying to run is like this only with a bigger JSON object...

#!perl use 5.006; use strict; use warnings; use Test::More; use Business::Stripe::Webhook; plan tests => 7; *STDIN = *DATA; my $webhook_fail = Business::Stripe::Webhook->new( 'signing_secret' => 'whsec_...', 'invoice-paid' => \&pay_invoice, ); ok( !$webhook_fail->success, "Didn't instantiate" ); is( $webhook_fail->error, "Looks like this is not a web request!", "No +t a web request" ); # Pretend we are on a webserver $ENV{'GATEWAY_INTERFACE'} = 'CGI/1.1'; $ENV{'CONTENT_LENGTH'} = 10024; $ENV{'HTTP_STRIPE_SIGNATURE'} = 't=ABCDEFGHIJ,v1=abcdefghij'; my $webhook_pass1 = Business::Stripe::Webhook->new( 'invoice-paid' => \&pay_invoice, ); ok( $webhook_pass1->success, "Basic instantiation" ); $webhook_pass1->process(); my $webhook_fail2 = Business::Stripe::Webhook->new( signing_secret => 'whsec_...', 'invoice-paid' => \&pay_invoice, ); is( $webhook_fail2->error, 'No payload data', "No payload for signed i +nstantiation" ); $webhook_fail2->process(); ok( !$webhook_fail2->success, "Signature error" ); is( $webhook_fail2->error, 'Invalid Stripe Signature', "Invalid signat +ure" ); sub pay_invoice { is( $_[0]->{'object'}, 'event', "pay.invoice handled" ); } __DATA__ { "id": "evt_1NFK32EfkkexSbWLZb6LoEap", "object": "event", "api_version": "2020-08-27", "data": { "object": { "id": "in_1NFK30EfkkfpSbWLeMoI8HzB", } } }