in reply to Re^4: Testing with Test::Mock::Tiny::HTTP
in thread Testing with Test::Mock::HTTP::Tiny
It works for me. To be sure, edit Test/Mock/HTTP/Tiny.pm (perldoc -l Test::Mock::HTTP::Tiny will tell you where this file is located) and put debugging messages after ## no critic. Just in case you haven't noticed, the return from my $resp = $http->get('http://www.way-finder.uk/'); is not an HTTP::response (which offers $resp->decoded_content) but a hash with keys headers, success, content, .... So you are looking for:
my $content = $resp->{success} && length $resp->{content} ? $resp->{co +ntent} : undef; ok(defined $content, "got content");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Solved! (was: Re^6: Testing with Test::Mock::HTTP::Tiny)
by Bod (Parson) on Sep 29, 2023 at 21:38 UTC | |
|
Re^6: Testing with Test::Mock::HTTP::Tiny
by Bod (Parson) on Sep 28, 2023 at 11:08 UTC | |
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 |