in reply to Re: Testing with Test::Mock::HTTP::Tiny
in thread Testing with Test::Mock::HTTP::Tiny
You need to "undump" the file contents somehow and resurrect the Perl data structure you started with. The simplest way to achieve this is by eval()'ing the text representation minus the $VAR1 = at the beginning of the string (placed there by Data::Dumper) (see the warnings at the end of this post):
Shameless plug: For many data structures, it's possible to do this more safely via my Data::Undump::PPI (see the disclaimer in Config::Perl).
However, looking at the source, it would seem the simpler solution is to just serialize Test::Mock::HTTP::Tiny->captured_data oneself in a more suitable format, perhaps JSON or YAML (AFAICT from looking at the source, the data structure doesn't look like it contains Perl objects that would pervent serialization, though at the moment I don't have the time to test).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Testing with Test::Mock::HTTP::Tiny
by bliako (Abbot) on Sep 27, 2023 at 10:19 UTC | |
by Bod (Parson) on Sep 27, 2023 at 14:39 UTC | |
by bliako (Abbot) on Sep 28, 2023 at 09:22 UTC | |
by Bod (Parson) on Sep 28, 2023 at 11:12 UTC | |
by Bod (Parson) on Sep 27, 2023 at 20:33 UTC | |
by bliako (Abbot) on Sep 28, 2023 at 09:47 UTC | |
by Bod (Parson) on Sep 29, 2023 at 21:38 UTC | |
by Bod (Parson) on Sep 28, 2023 at 11:08 UTC | |
by bliako (Abbot) on Sep 29, 2023 at 06:43 UTC | |
|