7d05d2d56f125dfa2c1269828d5deff247611ffd
[irspy-moved-to-github.git] / t / ZOOM-IRSpy.t
1 # change 'tests => 1' to 'tests => last_test_to_print';
2
3 use Test::More tests => 3;
4
5 BEGIN {
6     use lib './lib';
7     use_ok('ZOOM::IRSpy');
8 }
9
10 # Insert your test code below, the Test::More module is use()ed here so read
11 # its man page ( perldoc Test::More ) for help writing this test script.
12
13 use strict;
14 use warnings;
15
16 my $irspy_to_zeerex_xsl = 'xsl/irspy2zeerex.xsl';
17
18 $ZOOM::IRSpy::irspy_to_zeerex_xsl = $irspy_to_zeerex_xsl
19   if $irspy_to_zeerex_xsl;
20
21 my $dbname =  ZOOM::IRSpy::connect_to_registry();
22 my $spy = new ZOOM::IRSpy( $dbname, "admin", "fruitbat" );
23
24 isa_ok( $spy, 'ZOOM::IRSpy' );
25
26 # test for failure if template not exists
27 eval {
28     $ZOOM::IRSpy::irspy_to_zeerex_xsl = '/nonexist';
29     $ZOOM::IRSpy::xslt_max_depth = 100;
30     $spy = new ZOOM::IRSpy( $dbname, "admin", "fruitbat" );
31 };
32
33 like( $@, qr/No such file or directory/, "xslt configure test" );
34
35 1;
36
37 __DATA__;
38 foo