Lire::Test::TestCase(3pm)

Lire::Test::TestCase3pm

Common base for lire test cases.

Usage

 use base qw/Lire::Test::TestCase/;
 sub set_up {
     my $self = shift->SUPER::set_up();
     $self->{'cfg'}{'lr_schemas_path'} = [ $self->{'tmpdir'} ];
 }

Overview

This package can be used to write test cases for Lire instead of inheriting directly from Test::Unit::TestCase.

The default set_up method will create a Lire::Test::HashConfig object and set it up in the configuration framework. This makes it easy to set configuration variables to arbitrary values in the set_up() method.

It also sets the LC_MESSAGES locale category to 'C'.

If you override set_up() and tear_down() be sure to call the SUPER:: implementation.

This subclass also defined a new kind of assertion which make sure that a snippet of code died with a proper error message.

assert_died( $test, $regex, [ $msg ] )

Execute $test and fail unless it dies with a message matching $regex. $test should be a reference to CODE. $regex should be a Regexp ref.

assert_dies( $regex, $test, [ $msg ] )

Like assert_died() but with a signature closer to the one defined in Test::Unit::Assert.

assert_isa( $class, $instance, [ $msg ] )

Fails unless $instance is an instance of $class.

Version

$Id: TestCase.pm,v 1.17 2006/07/23 13:16:32 vanbaal Exp $

Releases

6 releases since Debian 3.1 (Sarge); the text changed 5 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. Arch

Authors

Francis J. Lacoste <[email protected]>

From lire 2.1.1-8 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.