Test::...teStore(3pm)

πŸ“¦
version 0.04 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble

πŸ¦‹ NAME πŸ¦‹

Test::Attean::Store::LDF::Role::CreateStore β€” bestie, this role literally builds you an LDF store for tests. That's the whole job. It's giving "test fixture but make it a Moo role" πŸ’…


✨ SYNOPSIS ✨

okay so there are two ways to do this, pick your fighter:

Either:

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

or:

  package TestCreateStore {
        use Moo;
        with 'Test::Attean::Store::LDF::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);

two flavours, same slay 🫢


πŸ’– DESCRIPTION πŸ’–

There are two ways of using this. No cap.

The original idea is to use it to test a triple/quad that uses Test::Attean::TripleStore, like in the first example in the synopsis. Classic. Iconic. The blueprint, fr fr.

It is also possible to utilize this role like in the second example to create a store for testing other parts of the code too. And the way that works is:

  1. first wrap a class around the role,
  2. then create an arrayref of triples, which should be used to populate the store,
  3. then instantiate an object of the class, and call it's create_store method with the triples.

Now you have a proper store that can be used in tests. periodt. πŸ’…βœ¨


πŸ‘‘ AUTHOR πŸ‘‘

Kjetil Kjernsmo <kjetilk@cpan.org>. Patrick Hochstenbach "<patrick.hochstenbach@ugent.be>"

two absolute legends, we stan 🌸


This software is copyright (c) 2015 by Patrick Hochstenbach. 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. free software bestie, go wild but respectfully 🧚


lowkey a whole moment: this page is perl v5.34.0, dated 2022-06-15, and lives in the User Contributed Perl Documentation for Test::...teStore(3pm). mwah, thanks for reading, bye bestie πŸ’–βœ¨πŸŽ€πŸ¦‹
πŸ“¦ where this page comes from