From c9c77e03ca1bc5d584f1818b3ff327b62702a15e Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Thu, 8 Apr 2010 10:54:34 +0000 Subject: [PATCH] add real tests --- t/ZOOM-IRSpy.t | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/t/ZOOM-IRSpy.t b/t/ZOOM-IRSpy.t index b60bbe0..2ed94b3 100644 --- a/t/ZOOM-IRSpy.t +++ b/t/ZOOM-IRSpy.t @@ -1,9 +1,36 @@ -# $Id: ZOOM-IRSpy.t,v 1.1 2007-04-18 11:23:01 mike Exp $ - # change 'tests => 1' to 'tests => last_test_to_print'; -use Test::More tests => 1; -BEGIN { use_ok('ZOOM::IRSpy') }; + +use Test::More qw(no_plan); + +BEGIN { + use_ok('ZOOM::IRSpy'); +} # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. +use strict; +use warnings; + +my $irspy_to_zeerex_xsl = 'xsl/irspy2zeerex.xsl'; + +$ZOOM::IRSpy::irspy_to_zeerex_xsl = $irspy_to_zeerex_xsl + if $irspy_to_zeerex_xsl; + +my $dbname = 'localhost:8018/IR-Explain---1'; +my $spy = new ZOOM::IRSpy( $dbname, "admin", "fruitbat" ); + +isa_ok( $spy, 'ZOOM::IRSpy' ); + +# test for failure if template not exists +eval { + $ZOOM::IRSpy::irspy_to_zeerex_xsl = '/nonexist'; + $spy = new ZOOM::IRSpy( $dbname, "admin", "fruitbat" ); +}; + +like( $@, qr/No such file or directory/, "xslt configure test" ); + +1; + +__DATA__; +foo -- 1.7.10.4