in reply to Re^5: Testing with Test::Mock::HTTP::Tiny
in thread Testing with Test::Mock::HTTP::Tiny
Just in case you haven't noticed, the return from my $resp = $http->get('http://www.way-finder.uk/'); is not an HTTP::response
Yes thanks - I had noticed that. At the point where we mock the data, we don't use $resp. But within the module we do this:
It's here that the module is croaking when I try to use mocked data.my $resp = $self->{'http'}->get($url); if (!$resp->{'success'}) { croak "WWW::Crawl: HTTP Response " . $resp->{'status'} . " - " . $ +resp->{'reason'}; } $page = $resp->{'content'};
perldoc -l Test::Mock::HTTP::Tiny
That's helpful thanks...
Definitely easier than searching manually!
I'll add some debugging code a little later when more time is available. I'll try and get the module uploaded to GitHub later.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Testing with Test::Mock::HTTP::Tiny
by bliako (Abbot) on Sep 29, 2023 at 06:43 UTC | |
by Bod (Parson) on Sep 29, 2023 at 20:05 UTC | |
by afoken (Chancellor) on Sep 29, 2023 at 21:57 UTC | |
by Bod (Parson) on Sep 30, 2023 at 00:05 UTC | |
by Bod (Parson) on Sep 29, 2023 at 21:32 UTC |