Location

Qwiratry::Test::Location

Reusable conformance ("contract") tests for Qwiratry location plugins.

A location plugin provides Qwiratry::Location::<NAME>::Source and/or Qwiratry::Location::<NAME>::Destination classes that inherit the contracts in Qwiratry::Location::Base. This module asserts, from the outside, that such a plugin satisfies the shared contract: it is discoverable through the factory, its operation classes inherit the correct base, its URI scheme resolves to the backend, it round-trips (when writable and readable), reports missing locations as X::Qwiratry::IO::LocationError, and works through the ⮳ / ⮷ pipeline operators.

Synopsis

use Test;
use Qwiratry::Test::Location;

my $tmp = $*TMPDIR.add("qwiratry-{$*PID}.txt").absolute;

conforms-to-location-contract(
    backend             => 'File',
    scheme              => 'file',
    sample-location     => $tmp,
    roundtrip-location  => $tmp,
    missing-location    => $*TMPDIR.add("does-not-exist-{$*PID}").absolute,
);

done-testing;

Network-backed backends should pass :needs-network; those subtests are skipped unless QWIRATRY_TEST_NETWORK is set, so plugin CI stays hermetic by default.

Requires

RAKUDO_RAKUAST=1 (inherited from Qwiratry's slang).

Qwiratry::Test v0.0.1

Reusable conformance ('contract') test kit for Qwiratry Format and Location plugins.

Authors

  • Tim Nelson

License

Dependencies

Test Dependencies

Provides

  • Qwiratry::Test::Format
  • Qwiratry::Test::Location

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.