HashConfig(3pm)

πŸ“¦ version 2.1.1, in arch rolling

πŸ’– 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 into new(). That's it, that's the deal πŸ’…
  • Trying to get other configuration variables? Nope. It throws a No such configuration variable exception β€” 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 (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