permissions
[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
12 use lib './lib';
13 use_ok('ZOOM::IRSpy');
14
15 plan tests => 3;
16
17 # Insert your test code below, the Test::More module is use()ed here so read
18 # its man page ( perldoc Test::More ) for help writing this test script.
19
20 use strict;
21 use warnings;
22
23 my $irspy_to_zeerex_xsl = 'xsl/irspy2zeerex.xsl';
24
25 $ZOOM::IRSpy::irspy_to_zeerex_xsl = $irspy_to_zeerex_xsl
26   if $irspy_to_zeerex_xsl;
27
28 my $dbname =  ZOOM::IRSpy::connect_to_registry();
29 my $spy = new ZOOM::IRSpy( $dbname, "admin", "fruitbat" );
30
31 isa_ok( $spy, 'ZOOM::IRSpy' );
32
33 # test for failure if template not exists
34 eval {
35     $ZOOM::IRSpy::irspy_to_zeerex_xsl = '/nonexist';
36     $ZOOM::IRSpy::xslt_max_depth = 100;
37     $spy = new ZOOM::IRSpy( $dbname, "admin", "fruitbat" );
38 };
39
40 like( $@, qr/No such file or directory/, "xslt configure test" );
41
42 1;
43
44 __DATA__;
45 foo