Test::...eStore(3pm)

πŸ“¦
version 0.012 Β· 4 versions
, in debian bookworm, ubuntu noble, ubuntu questing

πŸ’– Test::Attean::Store::SPARQL::Role::CreateStore πŸ’–

okay so bestie, this page lives in the User Contributed Perl Documentation corner of your perldoc, and the manual it's from is the one labelled Test::...eStore(3pm) 🫢 (yes the name got absolutely chopped, we don't talk about it, but that's her).


✨ NAME ✨

Test::Attean::Store::SPARQL::Role::CreateStore β€” no cap, this role's whole job is creating a SPARQL store for tests 🌈


🌸 SYNOPSIS 🌸

you have two vibes to pick from, bestie. option one:

use Test::More;
use Test::Roo;
with 'Test::Attean::TripleStore', 'Test::Attean::Store::SPARQL::Role::CreateStore';
run_me;
done_testing;

or, option two:

package TestCreateStore {
      use Moo;
      with 'Test::Attean::Store::SPARQL::Role::CreateStore';
};
my $triples = [
                                 triple(iri('http://example.org/bar'), iri('http://example.org/c'), iri('http://example.org/foo')),
             # [...]
                                ];

my $test = TestCreateStore->new;
my $store = $test->create_store(triples => $triples);

like... pick your fighter πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so there are two ways to use this thing, and honestly both of them ate πŸ’–

The original idea β€” the classic, the blueprint, the main character β€” is to use it to test a triple/quad that uses Test::Attean::TripleStore, exactly like that first example up in the synopsis ✨

But you can also use this role like the second example, and lowkey it's giving versatility, because then you're creating a store for testing other parts of your code too πŸŽ€ In that example the order of operations is: first you wrap a class around the role, then you build an arrayref of triples, and those are the ones that should be used to populate the store. Then you instantiate an object of that class and call its create_store method with the triples. And boom β€” now you have a proper store you can use in your tests πŸ‘‘


πŸ‘‘ AUTHOR πŸ‘‘

Kjetil Kjernsmo <kjetilk@cpan.org>.


This software is copyright (c) 2015, 2016 by Kjetil Kjernsmo.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the whole page, bestie 🫢 this edition was brought to you by perl v5.36.0, dated 2022-11-20, under the manual page Test::...eStore(3pm) β€” go forth and test, slay, periodt πŸ’…πŸ’–

πŸ“¦ where this page comes from