NAME
Airlock::Test::Store - Contract tests for an Airlock store
VERSION
version 0.001
SYNOPSIS
use Test::More;
use Airlock::Test::Store;
Airlock::Test::Store->new( store => {
insert => sub { ... },
find => sub { ... },
update => sub { ... },
purge => sub { ... },
} )->run;
done_testing;
DESCRIPTION
Whoever writes the four store subs for Airlock runs this suite against them. It checks what Airlock relies on: rows come back as they went in, a secret or a user code is unique, update only fires from the expected state and adds where it is given a reference to a number, and purge removes what has expired and nothing else.
The suite inserts rows whose hash starts with airlock-test-. Run it against an empty table.
store
Required. The hash of coderefs under test: insert, find, update and, if the store has one, purge.
row
my $row = $suite->row( hash => 'airlock-test-2', user_code => undef );
A complete row with every field Airlock writes, for use in own tests.
run
$suite->run;
Runs the contract as subtests of the calling test file.
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-airlock/issues.
IRC
Join #kubernetes on irc.perl.org or message Getty directly.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <getty@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.