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 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