File: load-file.t

package info (click to toggle)
libjson-validator-perl 3.06%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 616 kB
  • sloc: perl: 1,308; makefile: 6
file content (13 lines) | stat: -rw-r--r-- 403 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
use Mojo::Base -strict;
use Test::More;
use JSON::Validator;

my $spec      = Mojo::File::path(qw(t spec person.json))->to_abs;
my $validator = JSON::Validator->new;

note "file://$spec";
ok eval { $validator->schema("file://$spec") }, 'loaded from file://';
isa_ok($validator->schema, 'Mojo::JSON::Pointer');
is $validator->schema->get('/title'), 'Example Schema', 'got example schema';

done_testing;