import Scalar::Util to test weaken references of perl objects
[irspy-moved-to-github.git] / t / ZOOM-IRSpy.t
1 # change 'tests => 1' to 'tests => last_test_to_print';
2
3 use Test::More qw(no_plan);
4
5 BEGIN {
6     use_ok('ZOOM::IRSpy');
7 }
8
9 # Insert your test code below, the Test::More module is use()ed here so read
10 # its man page ( perldoc Test::More ) for help writing this test script.
11
12 use strict;
13 use warnings;
14
15 my $irspy_to_zeerex_xsl = 'xsl/irspy2zeerex.xsl';
16
17 $ZOOM::IRSpy::irspy_to_zeerex_xsl = $irspy_to_zeerex_xsl
18   if $irspy_to_zeerex_xsl;
19
20 my $dbname = 'localhost:8018/IR-Explain---1';
21 my $spy = new ZOOM::IRSpy( $dbname, "admin", "fruitbat" );
22
23 isa_ok( $spy, 'ZOOM::IRSpy' );
24
25 # test for failure if template not exists
26 eval {
27     $ZOOM::IRSpy::irspy_to_zeerex_xsl = '/nonexist';
28     $ZOOM::IRSpy::debug = 1;
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