Test::Sah::Schema - Test Sah::Schema::* modules in distribution
This document describes version 0.007 of Test::Sah::Schema (from Perl distribution Test-Sah-Schema), released on 2020-03-04.
To check a single Sah::Schema::* module:
use Test::Sah::Schema tests=>1; sah_schema_module_ok("Sah::Schema::Foo", {opt => ...}, $msg);
To check all Sah::Schema::* modules in a distro:
# save in release-sah-schema.t, put in distro's t/ subdirectory use Test::More; plan skip_all => "Not release testing" unless $ENV{RELEASE_TESTING}; eval "use Test::Sah::Schema"; plan skip_all => "Test::Sah::Schema required for testing Sah::Schema modules" if $@; sah_schema_modules_ok({opt => ...}, $msg);
This module performs various checks on Sah::Schema::* modules. It is recommended that you include something like release-sah-schema.t in your distribution if you add metadata to your code. If you use Dist::Zilla to build your distribution, there is Dist::Zilla::Plugin::Sah::Schemas to make it easy to do so.
release-sah-schema.t
Some code taken from Test::Pod::Coverage by Andy Lester.
All these functions are exported by default.
Load $module, get its $schema, and perform test on it.
$module
$schema
Available options:
test_schema_examples => BOOL (default: 1)
Whether to test examples in schema.
Look for modules in directory lib (or blib instead, if it exists), and run sah_schema_module_ok() on each of them.
lib
blib
run sah_schema_module_ok()
Options are the same as in sah_schema_module_ok(), plus:
sah_schema_module_ok()
include_modules
exclude_modules
Please visit the project's homepage at https://metacpan.org/release/Test-Sah-Schema.
Source repository is at https://github.com/perlancar/perl-Test-Sah-Schema.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Sah-Schema
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
test-sah-schema, a command-line interface for sah_schema_modules_ok().
sah_schema_modules_ok()
Test::Sah to use Sah schema to test data.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2020 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Test::Sah::Schema, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Sah::Schema
CPAN shell
perl -MCPAN -e shell install Test::Sah::Schema
For more information on module installation, please visit the detailed CPAN module installation guide.