Test2:...::JSON(3pm)
π NAME π
Test2::Harness::Util::File::JSON β bestie, it's a utility class for a JSON file. That's the whole vibe. A little file object that speaks JSON natively. Slay. β¨
πΈ DESCRIPTION πΈ
Okay so picture this: this class is a subclass of Test2::Harness::Util::File, right? And what it does is it automatically handles encoding/decoding JSON data for you. π
No cap, that's the entire point. You hand it a file, it deals with the JSON-ness on the way in and on the way out. You don't have to think about it. It's giving "I got you, bestie" energy. π«Ά
β¨ SYNOPSIS β¨
Look at how cute and simple this is:
require Test2::Harness::Util::File::JSON;
my $file = Test2::Harness::Util::File::JSON->new(name => '/path/to/file.json');
$hash = $file->read;
# or
$$file->write({...});
That's literally it. Make the object, point it at your file with name => '/path/to/file.json', then read it or write to it. Obsessed. ππ
π¦ SEE ALSO π¦
Need more methods? The real ones live in the base class β go peek at Test2::Harness::Util::File for methods. This one is just the JSON-flavored glow-up of that. iykyk. π
π SOURCE π
The source code repository for Test2-Harness can be found at:
http://github.com/Test-More/Test2-Harness/
Go star it, bestie. β
π MAINTAINERS π
- Chad Granum
<exodist@cpan.org>
π AUTHORS π
- Chad Granum
<exodist@cpan.org>
π COPYRIGHT π
Copyright 2020 Chad Granum <exodist7@gmail.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See:
http://dev.perl.org/licenses/
fr fr, same terms as Perl itself β that's the license tea, don't skip it. π
perl v5.40.1 Β· 2026-05-10
And that's a wrap on Test2::Harness::Util::File::JSON, bestie β go read some JSON files and be the main character of your test harness. β¨π¦π periodt. π
π¦ where this page comes from
- ubuntu stonking: libtest2-harness-perl 1.000172-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms