File: 00-load.t

package info (click to toggle)
libcatmandu-crossref-perl 0.007-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 116 kB
  • sloc: perl: 78; makefile: 2
file content (46 lines) | stat: -rw-r--r-- 906 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use strict;
use warnings;
use Test::More;
use Test::Exception;

my $pkg;

BEGIN {
    $pkg = 'Catmandu::Importer::CrossRef';
    use_ok $pkg;
}

require_ok $pkg;

dies_ok { $pkg->new( fmt => "unixref" ) } "die of missing arguments";
dies_ok {
    $pkg->new( fmt => "unixref", doi => "10.1088/1126-6708/2009/03/112" );
}
"die of missing arguments";
dies_ok { $pkg->new( usr => 'me@example.com' ) } "die of missing arguments";
lives_ok {
    $pkg->new(
        fmt => "unixref",
        doi => "10.1088/1126-6708/2009/03/112",
        usr => 'me@example.com',
    );
}
"I'm alive";
lives_ok {
    $pkg->new(
        doi => "10.1088/1126-6708/2009/03/112",
        usr => 'me@example.com',
    );
}
"I'm alive";

my $importer = $pkg->new(
    fmt => "unixref",
    doi => "10.1088/1126-6708/2009/03/112",
    usr => 'me@example.com',
);

isa_ok( $importer, $pkg );
can_ok( $importer, 'each' );

done_testing;