File: fix-uri-status-code.t

package info (click to toggle)
libcatmandu-identifier-perl 0.15-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 292 kB
  • sloc: perl: 978; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 578 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env perl

use strict;
use Test::More;
use Test::Exception;

my $pkg;

BEGIN {
    $pkg = 'Catmandu::Fix::uri_status_code';
    use_ok $pkg;
}
require_ok $pkg;

dies_ok {$pkg->new()->fix({foo => 'http://librecat.org'})} "path required";

lives_ok {$pkg->new('foo')->fix({foo => 'http://librecat.org'})}
"call fix with path";

SKIP: {
    skip("No network. Set NETWORK_TEST to run these tests.", 5)
        unless $ENV{NETWORK_TEST};

    my $x = $pkg->new('foo')->fix({foo => 'http://librecat.org'});

    is $x->{foo}, "200", "checked live website";
}

done_testing;