File: 0_basic.t

package info (click to toggle)
librdf-helper-perl 2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 336 kB
  • sloc: perl: 1,827; makefile: 11
file content (30 lines) | stat: -rw-r--r-- 757 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
use Test::More;
use strict;
use warnings;

BEGIN {
    use_ok('RDF::Helper');
    use_ok('RDF::Helper::Constants');
}

my $found_libs = 0;

test( base => 'RDF::Redland', class => 'RDF::Helper::RDFRedland' );
test( base => 'RDF::Trine', class => 'RDF::Helper::RDFTrine' );

ok( $found_libs > 0) or diag("You must have one of Perl's RDF libraries (RDF::Redland, RDF::Trine etc.) installed for this package to work!!!");

sub test {
    my %args = @_;
  SKIP: {
        eval "require $args{base}";
        skip "$args{base} not installed", 1 if $@;

        my $helper = RDF::Helper->new( BaseInterface => $args{base} );
        $found_libs++;
        isa_ok( $helper, 'RDF::Helper' );
        isa_ok($helper->backend, $args{class} );
    }
}

done_testing();