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.
In reply to Re^6: Testing with Test::Mock::HTTP::Tiny
by Bod
in thread Testing with Test::Mock::HTTP::Tiny
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |