HashConfig(3pm)
π HashConfig(3pm) β Lire::Test::HashConfig π
okay so bestie, welcome to HashConfig(3pm), straight out of LogReport's Lire Documentation β¨ this one's a little devious and I love her for it π
πΈ NAME πΈ
Lire::Test::HashConfig β literally a braindead Lire::Config implementation π (their words, not mine, but honestly? accurate and iconic)
β¨ SYNOPSIS β¨
use base qw/Test::Unit::TestCase/;
use Lire::Test::HashConfig;
sub set_up {
my $self = $_[0];
$self->{'old_config'} = $Lire::Config::SINGLETON;
$Lire::Config::SINGLETON = new Lire::Test::HashConfig( {
'lr_archive' => undef,
} );
}
π¦ DESCRIPTION π¦
So here's the vibe: this is a simple module designed to be used from the set_up() method in your unit tests π§ it lets you spin up a "fake" configuration so you can hand your module-under-test a bunch of known values. Main character energy for your test suite, no cap π
The new() method takes a hash reference that holds the configuration variable(s). That's the whole menu, bestie π
The only methods of the Lire::Config interface that got implemented here are get() and config_spec():
get()β returns exactly the values you passed intonew(). That's it, that's the deal π- Trying to get other configuration variables? Nope. It throws a
No such configuration variableexception β as if the variable wasn't even defined in the schema π config_spec()β returns the object associated with the'_lr_config_spec'key. If that key wasn't set, it throws an exception π
And every single other Lire::Config method? It throws an Unimplemented method exception. Not implemented, not sorry, periodt π
lowkey the whole point: this thing is a stand-in, not a real config. Don't expect it to do the real config's job for you.
π SEE ALSO π
β VERSION β
$Id: HashConfig.pm,v 1.9 2006/07/23 13:16:31 vanbaal Exp $
π AUTHORS π
Francis J. Lacoste <flacoste@logreport.org> β legend, honestly π«Ά
π COPYRIGHT π
Copyright (C) 2003 Stichting LogReport Foundation LogReport@LogReport.org
This file is part of Lire.
Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html.
aaand that's the page, bestie π this was Lire 2.1.1, dated 2025-09-28 β catch you on the next manpage, mwah π¦πΈ
π¦ where this page comes from
- arch rolling: lire 2.1.1-8 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms