Remove four of the old IRSpy database dumps -- we don't need them all.
[irspy-moved-to-github.git] / t / ZOOM-IRSpy.t
1 # change 'tests => 1' to 'tests => last_test_to_print';
2
3 BEGIN {
4     system( "zoomsh", "-e", "open localhost:8018", "quit" );
5     if ($?) {
6         print "1..0 # skip no zebra running on localhost:8018\n";
7         exit;
8     }
9 }
10
11 use Test::More tests => 3;
12 use lib './lib';
13 use_ok('ZOOM::IRSpy');
14
15 # Insert your test code below, the Test::More module is use()ed here so read
16 # its man page ( perldoc Test::More ) for help writing this test script.
17
18 use strict;
19 use warnings;
20
21 my $irspy_to_zeerex_xsl = 'xsl/irspy2zeerex.xsl';
22
23 $ZOOM::IRSpy::irspy_to_zeerex_xsl = $irspy_to_zeerex_xsl
24   if $irspy_to_zeerex_xsl;
25
26 my $dbname =  ZOOM::IRSpy::connect_to_registry();
27 my $spy = new ZOOM::IRSpy( $dbname, "admin", "fruitbat" );
28
29 isa_ok( $spy, 'ZOOM::IRSpy' );
30
31 # test for failure if template not exists
32 eval {
33     $ZOOM::IRSpy::irspy_to_zeerex_xsl = '/nonexist';
34     $ZOOM::IRSpy::xslt_max_depth = 100;
35     $spy = new ZOOM::IRSpy( $dbname, "admin", "fruitbat" );
36 };
37
38 like( $@, qr/No such file or directory/, "xslt configure test" );
39
40 1;
41
42 __DATA__;
43 foo